Skip to content

Commit

Permalink
Make README.md example compile (elastic#130)
Browse files Browse the repository at this point in the history
Make README.md example compile
  • Loading branch information
sherifabdlnaby authored and Steffen Siering committed Feb 27, 2019
1 parent 0539807 commit c5859d3
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 @@ -57,7 +57,7 @@ ucfg allows to automatically validate fields and set defaults for fields in case
```golang
// Defines struct to read config from
type ExampleConfig struct {
Counter string `config:"counter" validate:"min=0, max=9"`
Counter int `config:"counter" validate:"min=0, max=9"`
}

// Defines default config option
Expand All @@ -71,12 +71,12 @@ func main() {
appConfig := defaultConfig // copy default config so it's not overwritten
config, err := yaml.NewConfigWithFile(path, ucfg.PathSep("."))
if err != nil {
fmt.Fprintln(err)
fmt.Println(err)
os.Exit(1)
}
err = config.Unpack(&appConfig)
if err != nil {
fmt.Fprintln(err)
fmt.Println(err)
os.Exit(1)
}
}
Expand Down

0 comments on commit c5859d3

Please sign in to comment.