Skip to content

Commit 7fde464

Browse files
committed
Use ioutil package for compatibility with Go 1.13
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.
1 parent 19190fd commit 7fde464

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

internal/gojunitreport/go-junit-report_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"flag"
66
"fmt"
7+
"io/ioutil"
78
"os"
89
"path/filepath"
910
"regexp"
@@ -57,7 +58,7 @@ func testRun(inputFile, reportFile string, config Config, t *testing.T) {
5758
}
5859
defer input.Close()
5960

60-
wantReport, err := os.ReadFile(reportFile)
61+
wantReport, err := ioutil.ReadFile(reportFile)
6162
if os.IsNotExist(err) {
6263
t.Skipf("Skipping test with missing report file: %s", reportFile)
6364
} else if err != nil {

parser/gotest/json_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package gotest
22

33
import (
44
"io"
5+
"io/ioutil"
56
"strings"
67
"testing"
78

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

1617
func TestJSONReaderReadAll(t *testing.T) {
1718
r := newJSONReader(strings.NewReader(input))
18-
got, err := io.ReadAll(r)
19+
got, err := ioutil.ReadAll(r)
1920
if err != nil {
2021
t.Fatal(err)
2122
}

0 commit comments

Comments
 (0)