From bc5f30bf56c87a94e0f17dd67a15aa4b2d7e3fd4 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Sat, 28 Sep 2024 18:12:02 +0200 Subject: [PATCH] net,os: use os.LookupEnv instead of syscall.Getenv Change-Id: I3caf7cbf10bfb058b04eb2ace009c1dd76196d05 --- src/net/conf.go | 3 +-- src/os/exec/lp_windows.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/net/conf.go b/src/net/conf.go index 358f5434c4..1b48546f1b 100644 --- a/src/net/conf.go +++ b/src/net/conf.go @@ -13,7 +13,6 @@ import ( "os" "runtime" "sync" - "syscall" ) // The net package's name resolution is rather complicated. @@ -138,7 +137,7 @@ func initConfVal() { // prefer the cgo resolver. // Note that LOCALDOMAIN can change behavior merely by being // specified with the empty string. - _, localDomainDefined := syscall.Getenv("LOCALDOMAIN") + _, localDomainDefined := os.LookupEnv("LOCALDOMAIN") if localDomainDefined || os.Getenv("RES_OPTIONS") != "" || os.Getenv("HOSTALIASES") != "" { confVal.preferCgo = true return diff --git a/src/os/exec/lp_windows.go b/src/os/exec/lp_windows.go index 0e058d41b0..1225674306 100644 --- a/src/os/exec/lp_windows.go +++ b/src/os/exec/lp_windows.go @@ -10,7 +10,6 @@ import ( "os" "path/filepath" "strings" - "syscall" ) // ErrNotFound is the error resulting if a path search failed to find an executable file. @@ -154,7 +153,7 @@ func lookPath(file string, exts []string) (string, error) { dotf string dotErr error ) - if _, found := syscall.Getenv("NoDefaultCurrentDirectoryInExePath"); !found { + if _, found := os.LookupEnv("NoDefaultCurrentDirectoryInExePath"); !found { if f, err := findExecutable(filepath.Join(".", file), exts); err == nil { if execerrdot.Value() == "0" { execerrdot.IncNonDefault()