cleanup deprecated package io/ioutil (#4920)
Signed-off-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
parent
44fcca0e0d
commit
5191959bd7
26 changed files with 53 additions and 72 deletions
|
@ -3,7 +3,6 @@ package test
|
|||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -52,7 +51,7 @@ func TestReadme(t *testing.T) {
|
|||
defer remove(contents)
|
||||
|
||||
middle := filepath.Join("..", "plugin")
|
||||
dirs, err := ioutil.ReadDir(middle)
|
||||
dirs, err := os.ReadDir(middle)
|
||||
if err != nil {
|
||||
t.Fatalf("Could not read %s: %q", middle, err)
|
||||
}
|
||||
|
@ -173,7 +172,7 @@ func sectionsFromReadme(readme string) error {
|
|||
|
||||
func create(c map[string]string) {
|
||||
for name, content := range c {
|
||||
ioutil.WriteFile(name, []byte(content), 0644)
|
||||
os.WriteFile(name, []byte(content), 0644)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue