Skip to content

Commit fde6e08

Browse files
author
Aaron Schlesinger
committed
doc(pkg/sys/env.go): add godocs
1 parent 7edec8c commit fde6e08

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/sys/env.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@ func (r realEnv) Get(name string) string {
1616
return os.Getenv(name)
1717
}
1818

19+
// RealEnv returns an Env implementation that uses os.Getenv every time Get is called
1920
func RealEnv() Env {
2021
return realEnv{}
2122
}
2223

24+
// FakeEnv is an Env implementation that stores the environment in a map
2325
type FakeEnv struct {
26+
// Envs is the map from which Get calls will look to retrieve environment variables
2427
Envs map[string]string
2528
}
2629

30+
// NewFakeEnv returns a new FakeEnv with no values in Envs
2731
func NewFakeEnv() *FakeEnv {
2832
return &FakeEnv{Envs: make(map[string]string)}
2933
}
3034

35+
// Get is the Env interface implementation
3136
func (f *FakeEnv) Get(name string) string {
3237
return f.Envs[name]
3338
}

0 commit comments

Comments
 (0)