diff options
author | Nick Thomas <nick@gitlab.com> | 2019-01-15 23:36:21 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-01-15 23:36:21 +0000 |
commit | 1fcb56f42cdb2b6f562d8875abc4e33f7ef3e258 (patch) | |
tree | c246e5b43a1e7b5744e10e75d6ed125629f45936 /go/internal/testhelper/testhelper.go | |
parent | 6c5b195353a632095d7f672d28b9985fd879b077 (diff) | |
parent | d762f4ec9ea35cb00309b41ad60055cd3c5709ba (diff) | |
download | gitlab-shell-1fcb56f42cdb2b6f562d8875abc4e33f7ef3e258.tar.gz |
Merge branch 'bvl-feature-flag-commands' into 'master'
Parse commands to enable feature flags
See merge request gitlab-org/gitlab-shell!270
Diffstat (limited to 'go/internal/testhelper/testhelper.go')
-rw-r--r-- | go/internal/testhelper/testhelper.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/go/internal/testhelper/testhelper.go b/go/internal/testhelper/testhelper.go new file mode 100644 index 0000000..5cdab89 --- /dev/null +++ b/go/internal/testhelper/testhelper.go @@ -0,0 +1,17 @@ +package testhelper + +import "os" + +func TempEnv(env map[string]string) func() { + var original = make(map[string]string) + for key, value := range env { + original[key] = os.Getenv(key) + os.Setenv(key, value) + } + + return func() { + for key, originalValue := range original { + os.Setenv(key, originalValue) + } + } +} |