Skip to content

Commit

Permalink
Added options to set precedence to cli or env
Browse files Browse the repository at this point in the history
  • Loading branch information
pteich committed May 18, 2020
1 parent 6ad9ef5 commit 1e46d91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ conf := testConfig{
Debug: true,
}

// now parse values from first cli flags and then env into this var
// now parse values from first env and then cli into this var
err := configstruct.Parse(&conf)
if err != nil {...}

// if you prefer ENV with precedence over cli than use option
err := configstruct.Parse(&conf, configstruct.WithPrecedenceEnv())
if err != nil {...}

```

0 comments on commit 1e46d91

Please sign in to comment.