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:
Jakob Borg
2021-11-22 08:59:47 +01:00
committed by GitHub
parent bf89bffb0b
commit 4b750b6dc3
71 changed files with 190 additions and 235 deletions
+2 -3
View File
@@ -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