mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
16 lines
243 B
Go
16 lines
243 B
Go
package internal
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func setEnvVar(key, value string) func() {
|
|
flag := strings.ToUpper(EnvVarReplacer.Replace(key))
|
|
oldEnv := os.Getenv(flag)
|
|
os.Setenv(flag, value)
|
|
return func() {
|
|
os.Setenv(flag, oldEnv)
|
|
}
|
|
}
|