7 "github.com/bmizerany/assert"
11 testField string `cfg:"target_field" env:"TEST_ENV_FIELD"`
14func TestLoadEnvForStruct(t *testing.T) {
16 cfg := make(EnvOptions)
17 cfg.LoadEnvForStruct(&envTest{})
19 _, ok := cfg["target_field"]
20 assert.Equal(t, ok, false)
22 os.Setenv("TEST_ENV_FIELD", "1234abcd")
23 cfg.LoadEnvForStruct(&envTest{})
24 v := cfg["target_field"]
25 assert.Equal(t, v, "1234abcd")
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list