summaryrefslogtreecommitdiffstats
path: root/pkg/integration
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-08-02 08:21:55 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-08-02 08:32:57 +1000
commitc92ed07082b4f888eec0c9d5e31d44499bcf5b44 (patch)
treebf5e2bdec13bf4503bf06637cee34d5390ac2e29 /pkg/integration
parentdf0c3b3ea877dd56b2c33e54fafd9aeb3b087c24 (diff)
Appease linter
Diffstat (limited to 'pkg/integration')
-rw-r--r--pkg/integration/clients/go_test.go3
-rw-r--r--pkg/integration/components/runner.go3
-rw-r--r--pkg/integration/tests/test_list_generator.go13
3 files changed, 8 insertions, 11 deletions
diff --git a/pkg/integration/clients/go_test.go b/pkg/integration/clients/go_test.go
index 851059e15..18d8569bd 100644
--- a/pkg/integration/clients/go_test.go
+++ b/pkg/integration/clients/go_test.go
@@ -10,7 +10,6 @@ import (
"bytes"
"errors"
"io"
- "io/ioutil"
"os"
"os/exec"
"testing"
@@ -82,7 +81,7 @@ func runCmdHeadless(cmd *exec.Cmd) error {
return err
}
- _, _ = io.Copy(ioutil.Discard, f)
+ _, _ = io.Copy(io.Discard, f)
if cmd.Wait() != nil {
// return an error with the stderr output
diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go
index 40921fee9..32acdf25f 100644
--- a/pkg/integration/components/runner.go
+++ b/pkg/integration/components/runner.go
@@ -2,7 +2,6 @@ package components
import (
"fmt"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -222,7 +221,7 @@ func findOrCreateDir(path string) {
func deleteAndRecreateEmptyDir(path string) {
// remove contents of integration test directory
- dir, err := ioutil.ReadDir(path)
+ dir, err := os.ReadDir(path)
if err != nil {
if os.IsNotExist(err) {
err = os.Mkdir(path, 0o777)
diff --git a/pkg/integration/tests/test_list_generator.go b/pkg/integration/tests/test_list_generator.go
index 294165cca..f616f90a3 100644
--- a/pkg/integration/tests/test_list_generator.go
+++ b/pkg/integration/tests/test_list_generator.go
@@ -12,7 +12,6 @@ import (
"fmt"
"go/format"
"io/fs"
- "io/ioutil"
"os"
"strings"
@@ -26,19 +25,19 @@ func main() {
if err != nil {
panic(err)
}
- if err := ioutil.WriteFile("test_list.go", formattedCode, 0o644); err != nil {
+ if err := os.WriteFile("test_list.go", formattedCode, 0o644); err != nil {
panic(err)
}
}
func generateCode() []byte {
// traverse parent directory to get all subling directories
- directories, err := ioutil.ReadDir("../tests")
+ directories, err := os.ReadDir("../tests")
if err != nil {
panic(err)
}
- directories = lo.Filter(directories, func(file os.FileInfo, _ int) bool {
+ directories = lo.Filter(directories, func(file fs.DirEntry, _ int) bool {
// 'shared' is a special folder containing shared test code so we
// ignore it here
return file.IsDir() && file.Name() != "shared"
@@ -62,8 +61,8 @@ func generateCode() []byte {
return buf.Bytes()
}
-func appendDirTests(dir fs.FileInfo, buf *bytes.Buffer) {
- files, err := ioutil.ReadDir(fmt.Sprintf("../tests/%s", dir.Name()))
+func appendDirTests(dir fs.DirEntry, buf *bytes.Buffer) {
+ files, err := os.ReadDir(fmt.Sprintf("../tests/%s", dir.Name()))
if err != nil {
panic(err)
}
@@ -77,7 +76,7 @@ func appendDirTests(dir fs.FileInfo, buf *bytes.Buffer) {
strings.TrimSuffix(file.Name(), ".go"),
)
- fileContents, err := ioutil.ReadFile(fmt.Sprintf("../tests/%s/%s", dir.Name(), file.Name()))
+ fileContents, err := os.ReadFile(fmt.Sprintf("../tests/%s/%s", dir.Name(), file.Name()))
if err != nil {
panic(err)
}