Skip to content

Commit

Permalink
Use ioutil package for compatibility with Go 1.13
Browse files Browse the repository at this point in the history
We specify 1.13 in go.mod, so we should make sure it can be built and
tested on that version. Let's keep using the ioutil package for now,
since it was only deprecated from 1.16.
  • Loading branch information
jstemmer committed Jul 1, 2022
1 parent 19190fd commit 7fde464
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/gojunitreport/go-junit-report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -57,7 +58,7 @@ func testRun(inputFile, reportFile string, config Config, t *testing.T) {
}
defer input.Close()

wantReport, err := os.ReadFile(reportFile)
wantReport, err := ioutil.ReadFile(reportFile)
if os.IsNotExist(err) {
t.Skipf("Skipping test with missing report file: %s", reportFile)
} else if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion parser/gotest/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gotest

import (
"io"
"io/ioutil"
"strings"
"testing"

Expand All @@ -15,7 +16,7 @@ var input = `some other output

func TestJSONReaderReadAll(t *testing.T) {
r := newJSONReader(strings.NewReader(input))
got, err := io.ReadAll(r)
got, err := ioutil.ReadAll(r)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 7fde464

Please sign in to comment.