all: Remove usage of deprecated io/ioutil (#7971)
As of Go 1.16 io/ioutil is deprecated. This replaces usage with the corresponding functions in package os and package io.
This commit is contained in:
+2
-3
@@ -10,7 +10,6 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -67,7 +66,7 @@ func TestIgnores(t *testing.T) {
|
||||
|
||||
// Add some of them to an ignore file
|
||||
|
||||
err = ioutil.WriteFile("s1/.stignore",
|
||||
err = os.WriteFile("s1/.stignore",
|
||||
[]byte("f1*\nf2\nd1*\nd2\ns1*\ns2\n(?i)*.txt"), // [fds][34] only non-ignored items
|
||||
0644)
|
||||
if err != nil {
|
||||
@@ -92,7 +91,7 @@ func TestIgnores(t *testing.T) {
|
||||
// Change the pattern to include some of the files and dirs previously ignored
|
||||
|
||||
time.Sleep(1100 * time.Millisecond)
|
||||
err = ioutil.WriteFile("s1/.stignore", []byte("f2\nd2\ns2\n"), 0644)
|
||||
err = os.WriteFile("s1/.stignore", []byte("f2\nd2\ns2\n"), 0644)
|
||||
|
||||
// Rescan and verify that we see them
|
||||
|
||||
|
||||
Reference in New Issue
Block a user