diff --git a/cp/cmp/cmp.go b/cp/cmp/cmp.go index 5ac382c..67193cb 100644 --- a/cp/cmp/cmp.go +++ b/cp/cmp/cmp.go @@ -9,7 +9,6 @@ package cmp import ( "fmt" - "io/ioutil" "os" "path/filepath" "reflect" @@ -38,7 +37,7 @@ func isEqualFile(fpath1, fpath2 string) error { } func readDirNames(path string) ([]string, error) { - entries, err := ioutil.ReadDir(path) + entries, err := os.ReadDir(path) if err != nil { return nil, err } @@ -80,7 +79,7 @@ func IsEqualTree(o cp.Options, src, dst string) error { if err != nil { return err } - // ioutil.ReadDir guarantees these are sorted. + // os.ReadDir guarantees these are sorted. if !reflect.DeepEqual(srcEntries, dstEntries) { return fmt.Errorf("directory contents did not match:\n%q had %v\n%q had %v", src, srcEntries, dst, dstEntries) } diff --git a/uio/archivereader_test.go b/uio/archivereader_test.go index 52e70ae..012b373 100644 --- a/uio/archivereader_test.go +++ b/uio/archivereader_test.go @@ -64,6 +64,7 @@ func TestArchiveReaderPreReadShort(t *testing.T) { // randomString generates random string of fixed length in a fast and simple way. func randomString(l int) string { + //nolint rand.Seed(time.Now().UnixNano()) r := make([]byte, l) for i := 0; i < l; i++ {