diff options
author | Dean Deng <deandeng@google.com> | 2021-01-13 15:10:03 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-13 15:15:20 -0800 |
commit | 1efe0ebc5973ec8a06b881c087dae2183898504b (patch) | |
tree | 6587b91164883c87324abe602b438f3e3ace19cf /pkg/tcpip | |
parent | f34aaf7ef17aa10c7ba1923d0694347e47634192 (diff) |
Switch uses of os.Getenv that check for empty string to os.LookupEnv.
Whether the variable was found is already returned by syscall.Getenv.
os.Getenv drops this value while os.Lookupenv passes it along.
PiperOrigin-RevId: 351674032
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/link/sharedmem/sharedmem_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/link/sharedmem/sharedmem_test.go b/pkg/tcpip/link/sharedmem/sharedmem_test.go index dd2e1a125..9f5ee43d7 100644 --- a/pkg/tcpip/link/sharedmem/sharedmem_test.go +++ b/pkg/tcpip/link/sharedmem/sharedmem_test.go @@ -191,8 +191,8 @@ func shuffle(b []int) { } func createFile(t *testing.T, size int64, initQueue bool) int { - tmpDir := os.Getenv("TEST_TMPDIR") - if tmpDir == "" { + tmpDir, ok := os.LookupEnv("TEST_TMPDIR") + if !ok { tmpDir = os.Getenv("TMPDIR") } f, err := ioutil.TempFile(tmpDir, "sharedmem_test") |