From 35657e3262ff2ac0c794ac3840a7e0ab5b90b877 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 26 May 2023 16:00:56 -0700 Subject: [PATCH] add more env keys --- common/env.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/env.go b/common/env.go index 85b3681e2..4b5f4980c 100644 --- a/common/env.go +++ b/common/env.go @@ -6,7 +6,7 @@ type EnvKeyType string // gopsutil relies on to perform calls against the OS. // Example of use: // -// ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{"HOST_PROC": "/myproc"}) +// ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"}) // avg, err := load.AvgWithContext(ctx) var EnvKey = EnvKeyType("env") @@ -14,6 +14,10 @@ const ( HostProcEnvKey EnvKeyType = "HOST_PROC" HostSysEnvKey EnvKeyType = "HOST_SYS" HostEtcEnvKey EnvKeyType = "HOST_ETC" + HostVarEnvKey EnvKeyType = "HOST_VAR" + HostRunEnvKey EnvKeyType = "HOST_RUN" + HostDevEnvKey EnvKeyType = "HOST_DEV" + HostRootEnvKey EnvKeyType = "HOST_ROOT" ) type EnvMap map[EnvKeyType]string