summaryrefslogtreecommitdiffhomepage
path: root/test/root
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2021-01-13 15:10:03 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-13 15:15:20 -0800
commit1efe0ebc5973ec8a06b881c087dae2183898504b (patch)
tree6587b91164883c87324abe602b438f3e3ace19cf /test/root
parentf34aaf7ef17aa10c7ba1923d0694347e47634192 (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 'test/root')
-rw-r--r--test/root/crictl_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/root/crictl_test.go b/test/root/crictl_test.go
index fbf134014..c26dc8577 100644
--- a/test/root/crictl_test.go
+++ b/test/root/crictl_test.go
@@ -353,8 +353,8 @@ func setup(t *testing.T) (*criutil.Crictl, func(), error) {
// because the shims will be installed there, and containerd may infer
// the binary name and search the PATH.
runtimeDir := path.Dir(runtime)
- modifiedPath := os.Getenv("PATH")
- if modifiedPath != "" {
+ modifiedPath, ok := os.LookupEnv("PATH")
+ if ok {
modifiedPath = ":" + modifiedPath // We prepend below.
}
modifiedPath = path.Dir(getContainerd()) + modifiedPath