config,fetcher: remove SetAllEnv function
This commit is contained in:
parent
8ca4fcbade
commit
7aa4126f88
@ -133,13 +133,6 @@ func (c *Configuration) Setenv(key, value string) error {
|
||||
return c.Env.(*EnvFetcher).Set(key, value)
|
||||
}
|
||||
|
||||
// SetAllEnv is shorthand for `c.Env.SetAll(env)`.
|
||||
//
|
||||
// TODO(taylor): remove calls to this method and avoid cast.
|
||||
func (c *Configuration) SetAllEnv(env map[string]string) {
|
||||
c.Env.(*EnvFetcher).SetAll(env)
|
||||
}
|
||||
|
||||
// GetenvBool is shorthand for `c.Env.Bool(key, def)`.
|
||||
func (c *Configuration) GetenvBool(key string, def bool) bool {
|
||||
return c.Env.Bool(key, def)
|
||||
|
@ -91,18 +91,3 @@ func (e *EnvFetcher) Set(key, val string) error {
|
||||
|
||||
return os.Setenv(key, val)
|
||||
}
|
||||
|
||||
// SetAll replaces all key-value pairs with the given set, but does not modify
|
||||
// the system's environment.
|
||||
//
|
||||
// Note: this method is a temporary measure while some of the old tests still
|
||||
// rely on this mutable behavior.
|
||||
func (e *EnvFetcher) SetAll(env map[string]string) {
|
||||
e.vmu.Lock()
|
||||
defer e.vmu.Unlock()
|
||||
|
||||
e.vals = make(map[string]string)
|
||||
for k, v := range env {
|
||||
e.vals[k] = v
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user