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

Distinct behaviors of -flag false and -flag=false #70

Open
flowrean opened this issue Apr 27, 2018 · 0 comments
Open

Distinct behaviors of -flag false and -flag=false #70

flowrean opened this issue Apr 27, 2018 · 0 comments

Comments

@flowrean
Copy link

flowrean commented Apr 27, 2018

For boolean flag values, there is what seems to me inconsistent behavior.

Reusing the example from the README:

package main

import (
    "fmt"
    "github.com/koding/multiconfig"
)

type Server struct {
    Enabled bool
}

func main() {
    m := multiconfig.New()
    serverConf := new(Server)
    m.MustLoad(serverConf)

    fmt.Println(serverConf.Enabled)
}

Here are a few runs of the app:

$ app         
false
$ app -enabled
true
$ app -enabled=true
true
$ app -enabled=false
false
$ app -enabled true
true
$ app -enabled false
true

I would expect the last one to be false.

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

No branches or pull requests

1 participant