chore(nix/buildGo): cleanups
io/ioutil is deprecated, and the range expression can be simplified. Change-Id: I73b85991faafa333bddf90adbdefe2006f8d409c Reviewed-on: https://cl.tvl.fyi/c/depot/+/11460 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
d6583fe9c6
commit
82e59f471a
1 changed files with 3 additions and 4 deletions
7
nix/buildGo/external/main.go
vendored
7
nix/buildGo/external/main.go
vendored
|
@ -10,7 +10,6 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/build"
|
"go/build"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
@ -74,8 +73,8 @@ func findGoDirs(at string) ([]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
goDirs := []string{}
|
goDirs := []string{}
|
||||||
for k, _ := range dirSet {
|
for goDir := range dirSet {
|
||||||
goDirs = append(goDirs, k)
|
goDirs = append(goDirs, goDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
return goDirs, nil
|
return goDirs, nil
|
||||||
|
@ -148,7 +147,7 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadStdlibPkgs(from string) (pkgs map[string]bool, err error) {
|
func loadStdlibPkgs(from string) (pkgs map[string]bool, err error) {
|
||||||
f, err := ioutil.ReadFile(from)
|
f, err := os.ReadFile(from)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue