about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-18T17·54+0300
committerflokli <flokli@flokli.de>2024-04-19T12·39+0000
commit82e59f471a9b5d475c39773cdd27a9ada2f35962 (patch)
treee99c325453ae6ee7bf145922510f44caf2545490
parentd6583fe9c6cee6b060b37dbe1fb7efd2a286336d (diff)
chore(nix/buildGo): cleanups r/7958
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
-rw-r--r--nix/buildGo/external/main.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/nix/buildGo/external/main.go b/nix/buildGo/external/main.go
index a77c43b371e9..4402a8eb86ff 100644
--- a/nix/buildGo/external/main.go
+++ b/nix/buildGo/external/main.go
@@ -10,7 +10,6 @@ import (
 	"flag"
 	"fmt"
 	"go/build"
-	"io/ioutil"
 	"log"
 	"os"
 	"path"
@@ -74,8 +73,8 @@ func findGoDirs(at string) ([]string, error) {
 	}
 
 	goDirs := []string{}
-	for k, _ := range dirSet {
-		goDirs = append(goDirs, k)
+	for goDir := range dirSet {
+		goDirs = append(goDirs, goDir)
 	}
 
 	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) {
-	f, err := ioutil.ReadFile(from)
+	f, err := os.ReadFile(from)
 	if err != nil {
 		return
 	}