Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assertjson/assertjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package assertjson
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -39,7 +39,7 @@ type JSONAssertFunc func(json *AssertJSON)
// FileHas loads JSON from file and runs user callback for testing its nodes.
func FileHas(t TestingT, filename string, jsonAssert JSONAssertFunc) {
t.Helper()
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go version need to be upgraded to at least v1.16 in go.mod file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do u plan to support older versions of go in next releases?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 1.16

if err != nil {
assert.Fail(t, fmt.Sprintf(`failed to read file "%s": %s`, filename, err.Error()))
} else {
Expand Down
4 changes: 2 additions & 2 deletions assertxml/assertxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package assertxml
import (
"bytes"
"fmt"
"io/ioutil"
"os"

"github.com/stretchr/testify/assert"
"gopkg.in/xmlpath.v2"
Expand All @@ -56,7 +56,7 @@ type XMLAssertFunc func(xml *AssertXML)
// FileHas loads XML from file and runs user callback for testing its nodes.
func FileHas(t TestingT, filename string, xmlAssert XMLAssertFunc) {
t.Helper()
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
assert.Failf(t, "failed to read file '%s': %s", filename, err.Error())
} else {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/muonsoft/api-testing

go 1.13
go 1.16

require (
github.com/gofrs/uuid v4.4.0+incompatible
Expand Down
Loading