1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-27 22:18:41 +02:00

Move away from deprecated ioutils (#825)

Fix #806
This commit is contained in:
Minko Gechev
2023-05-16 09:06:52 +03:00
committed by GitHub
parent b508fa8d91
commit 6d5bc51b50
6 changed files with 20 additions and 17 deletions

View File

@@ -3,7 +3,6 @@ package fixtures
import (
"fmt"
"go/ast"
"io/ioutil"
"os"
"runtime"
"testing"
@@ -103,7 +102,7 @@ func getCompareFailCause(n *node, which int, prevValue string, prevIndex uint64)
func assertSuccess(t *testing.T, baseDir string, fi os.FileInfo, src []byte, rules []lint.Rule, config map[string]lint.RuleConfig) error { // MATCH /parameter 'src' seems to be unused, consider removing or renaming it as _/
l := lint.New(func(file string) ([]byte, error) {
return ioutil.ReadFile(baseDir + file)
return os.ReadFile(baseDir + file)
})
ps, err := l.Lint([][]string{[]string{fi.Name()}}, rules, lint.Config{