Update to Go 1.19

This commit is contained in:
eikendev 2023-02-11 23:41:42 +01:00
parent 21a4d156e1
commit 2ddc0fbd74
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
12 changed files with 85 additions and 43 deletions

View file

@ -3,7 +3,7 @@ package api
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"testing"
@ -123,7 +123,7 @@ func TestApi_RegisterApplication(t *testing.T) {
// Parse body only for successful requests
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
body, err := ioutil.ReadAll(w.Body)
body, err := io.ReadAll(w.Body)
require.NoErrorf(err, "Can not read request body")
err = json.Unmarshal(body, &application)
require.NoErrorf(err, "Can not unmarshal request body")
@ -158,7 +158,7 @@ func TestApi_GetApplications(t *testing.T) {
// Parse body only for successful requests
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
body, err := ioutil.ReadAll(w.Body)
body, err := io.ReadAll(w.Body)
require.NoErrorf(err, "Can not read request body")
err = json.Unmarshal(body, &applications)
require.NoErrorf(err, "Can not unmarshal request body")
@ -238,7 +238,7 @@ func TestApi_GetApplication(t *testing.T) {
// Parse body only for successful requests
if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {
body, err := ioutil.ReadAll(w.Body)
body, err := io.ReadAll(w.Body)
require.NoErrorf(err, "Can not read request body")
err = json.Unmarshal(body, &application)
require.NoErrorf(err, "Can not unmarshal request body: %v", err)