Skip to content

Commit

Permalink
docs: add required fields to examples (#139)
Browse files Browse the repository at this point in the history
Co-authored-by: Denis Krivak <denis.krivak@booking.com>
Co-authored-by: Oleg Kovalov <oleg@hey.com>
  • Loading branch information
3 people committed Apr 28, 2023
1 parent fdfa106 commit 35c6d95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ go get github.com/cristalhq/aconfig
type MyConfig struct {
Port int `default:"1111" usage:"just give a number"`
Auth struct {
User string `default:"def-user"`
Pass string `default:"def-pass"`
User string `required:"true"`
Pass string `required:"true"`
}
Pass string `default:"" env:"SECRET" flag:"sec_ret"`
}
Expand Down Expand Up @@ -74,7 +74,7 @@ if err := loader.Load(); err != nil {
// 1. defaults set in structure tags (see MyConfig defenition)
// 2. loaded from files `file.json` if not `ouch.yaml` will be used
// 3. from corresponding environment variables with the prefix `APP_`
// 4. command-line flags with the prefix `app.` if they are
// 4. command-line flags with the prefix `app.` if they are
```

Also see examples: [examples_test.go](https://github.com/cristalhq/aconfig/blob/master/example_test.go).
Expand Down

0 comments on commit 35c6d95

Please sign in to comment.