mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove ioutil.ReadDir from usage (#53550)
* add depguard rule for ioutil * replace ioutil.ReadDir with os.ReadDir * use legacy option in depguard supported in golangci-lint v1.40 * replace ioutil.ReadDir with os.ReadDir * return error for file info
This commit is contained in:
@@ -6,7 +6,6 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
@@ -42,7 +41,7 @@ func main() {
|
||||
cmroot := filepath.Join(groot, "pkg", "coremodel")
|
||||
tsroot := filepath.Join(groot, "packages", "grafana-schema", "src", "schema")
|
||||
|
||||
items, err := ioutil.ReadDir(cmroot)
|
||||
items, err := os.ReadDir(cmroot)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "could not read coremodels parent dir %s: %s\n", cmroot, err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user