diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2024-02-23 15:01:41 +0200 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2024-02-23 15:01:41 +0200 |
| commit | a3e10757a52fa47a0608afd88986162ca5eb22cc (patch) | |
| tree | dce61c6695bc3badd455a64767252e6947b32711 /integrationtests/fileutils.go | |
| parent | 85780654df870dc4170b93a8ed5a5dbfa917fe5d (diff) | |
lint warnings
Diffstat (limited to 'integrationtests/fileutils.go')
| -rw-r--r-- | integrationtests/fileutils.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/integrationtests/fileutils.go b/integrationtests/fileutils.go index d13617d..a1e1051 100644 --- a/integrationtests/fileutils.go +++ b/integrationtests/fileutils.go @@ -5,7 +5,6 @@ import ( "crypto/sha256" "encoding/base64" "fmt" - "io/ioutil" "os" "os/exec" "strings" @@ -25,7 +24,7 @@ func mapFile(t *testing.T, file string) (map[string]int, error) { scanner.Split(bufio.ScanLines) for scanner.Scan() { line := scanner.Text() - count, _ := contents[line] + count := contents[line] contents[line] = count + 1 } @@ -59,13 +58,11 @@ func compareFilesContents(t *testing.T, fileA, fileB string) error { } // The mapreduce result can be in a different order each time (Golang maps are not sorted). - t.Log(fmt.Sprintf("Checking whether %s has same lines as file %s (ignoring line order)", - fileA, fileB)) + t.Logf("Checking whether %s has same lines as file %s (ignoring line order)", fileA, fileB) if err := compareMaps(a, b); err != nil { return err } - t.Log(fmt.Sprintf("Checking whether %s has same lines as file %s (ignoring line order)", - fileB, fileA)) + t.Logf("Checking whether %s has same lines as file %s (ignoring line order)", fileB, fileA) if err := compareMaps(b, a); err != nil { return err } @@ -108,7 +105,7 @@ func fileContainsStr(t *testing.T, file, str string) error { } func shaOfFile(t *testing.T, file string) string { - bytes, err := ioutil.ReadFile(file) + bytes, err := os.ReadFile(file) if err != nil { t.Error(err) } |
