Skip to content

Commit

Permalink
Replace deprecated ioutil.ReadAll with io.ReadAll
Browse files Browse the repository at this point in the history
  • Loading branch information
mtnmunuklu committed Jan 27, 2024
1 parent 65719a8 commit de3e18b
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions api/handlers/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"encoding/json"
"flag"
"io/ioutil"
"io"
"net/http"
"strings"
"testing"
Expand Down Expand Up @@ -45,7 +45,7 @@ func TestSignUp(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -83,7 +83,7 @@ func TestSignIn(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -119,7 +119,7 @@ func TestGetUser(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand All @@ -143,7 +143,7 @@ func TestGetUser(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -183,7 +183,7 @@ func TestDeleteUser(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand All @@ -207,7 +207,7 @@ func TestDeleteUser(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -240,7 +240,7 @@ func TestChangeUserRole(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -272,7 +272,7 @@ func TestChangeUserRole(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -305,7 +305,7 @@ func TestUpdateUserPasword(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -338,7 +338,7 @@ func TestUpdateUserPasword(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -371,7 +371,7 @@ func TestUpdateUserEmail(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -404,7 +404,7 @@ func TestUpdateUserEmail(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -437,7 +437,7 @@ func TestUpdateUserName(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -470,7 +470,7 @@ func TestUpdateUserName(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down Expand Up @@ -503,7 +503,7 @@ func TestGetUsers(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err := ioutil.ReadAll(response.Body)
body, err := io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand All @@ -525,7 +525,7 @@ func TestGetUsers(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, response)

body, err = ioutil.ReadAll(response.Body)
body, err = io.ReadAll(response.Body)
assert.NoError(t, err)
assert.NotNil(t, body)

Expand Down

0 comments on commit de3e18b

Please sign in to comment.