diff options
| author | Mateusz Poliwczak <mpoliwczak34@gmail.com> | 2024-09-28 16:20:58 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-09-30 12:38:46 +0000 |
| commit | 0fb33863b78c03f4f3d6228e310869f2edff1195 (patch) | |
| tree | 4f72ed8cfec53a003fcc77bb9b6b9d9447691311 /src/os/exec | |
| parent | 869932d700cf161c19eec65d66b9fe55482698db (diff) | |
| download | go-0fb33863b78c03f4f3d6228e310869f2edff1195.tar.xz | |
net,os: use os.LookupEnv instead of syscall.Getenv
The os package already has a function for retrieving an environment
variable with a ok boolean, we don't need to use syscall directly.
Change-Id: Ife873e7245261ec765b628e31a0e7a7bc4dff934
GitHub-Last-Rev: bc5f30bf56c87a94e0f17dd67a15aa4b2d7e3fd4
GitHub-Pull-Request: golang/go#69700
Reviewed-on: https://go-review.googlesource.com/c/go/+/616342
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/os/exec')
| -rw-r--r-- | src/os/exec/lp_windows.go | 3 |
1 files changed, 1 insertions, 2 deletions
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() |
