1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-11-25 22:32:57 +02:00

test/fix environment var parsing

This commit is contained in:
Jehiah Czebotar
2014-11-14 23:06:07 -05:00
parent d552effc1e
commit 1c5a01cb7b
3 changed files with 31 additions and 3 deletions

View File

@@ -48,14 +48,14 @@ func main() {
opts := NewOptions()
var cfg map[string]interface{}
cfg := make(EnvOptions)
if *config != "" {
_, err := toml.DecodeFile(*config, &cfg)
if err != nil {
log.Fatalf("ERROR: failed to load config file %s - %s", *config, err)
}
}
LoadOptionsFromEnv(opts, cfg)
cfg.LoadEnvForStruct(opts)
options.Resolve(opts, flagSet, cfg)
err := opts.Validate()