Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct README #66

Merged
merged 1 commit into from
Sep 15, 2016
Merged

correct README #66

merged 1 commit into from
Sep 15, 2016

Conversation

spacewander
Copy link
Contributor

No description provided.


func main() {
config, err := yaml.NewConfigWithFile(path, ucfg.PathSep("."))
config.Unpack(defaultConfig)
config.Unpack(&defaultConfig)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice in past, but this should become:

appConfig := defaultConfig // copy default config so it's not overwritten
config, err := yaml.NewConfigWithFile(path, ucfg.PathSep("."))
if err != nil {
    fmt.Fprintln(err)
    os.Exit(1)
}
err = config.Unpack(&appConfig)
if err != nil {
    fmt.Fprintln(err)
    os.Exit(1)
}

@spacewander
Copy link
Contributor Author

@urso I have updated it. Thanks for your advise!

@urso
Copy link

urso commented Sep 15, 2016

Thanks for finding AND fixing these!

@urso urso merged commit f68e111 into elastic:master Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants