mirror of
https://github.com/pushbits/server.git
synced 2025-05-10 07:26:59 +02:00
Update to Go 1.19
This commit is contained in:
parent
21a4d156e1
commit
2ddc0fbd74
12 changed files with 85 additions and 43 deletions
|
@ -2,7 +2,7 @@ package api
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
|
@ -73,7 +73,7 @@ func TestApi_GetUsers(t *testing.T) {
|
|||
|
||||
// Get users from body
|
||||
users := make([]model.ExternalUser, 0)
|
||||
usersRaw, err := ioutil.ReadAll(w.Body)
|
||||
usersRaw, err := io.ReadAll(w.Body)
|
||||
require.NoErrorf(err, "Failed to parse response body")
|
||||
err = json.Unmarshal(usersRaw, &users)
|
||||
require.NoErrorf(err, "Can not unmarshal users")
|
||||
|
@ -173,7 +173,7 @@ func TestApi_GetUser(t *testing.T) {
|
|||
// Check content for successful requests
|
||||
if testCase.ShouldReturn == 200 {
|
||||
user := &model.ExternalUser{}
|
||||
userBytes, err := ioutil.ReadAll(w.Body)
|
||||
userBytes, err := io.ReadAll(w.Body)
|
||||
require.NoErrorf(err, "(Test case %s) Can not read body", testCase.Name)
|
||||
err = json.Unmarshal(userBytes, user)
|
||||
require.NoErrorf(err, "(Test case %s) Can not unmarshal body", testCase.Name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue