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

flags with string literal "null" get skipped #17

Open
abraithwaite opened this issue Sep 8, 2017 · 2 comments
Open

flags with string literal "null" get skipped #17

abraithwaite opened this issue Sep 8, 2017 · 2 comments

Comments

@abraithwaite
Copy link
Contributor

This was unexpected behavior for me. I imagine it has to do with JSON/yaml parsing support.

Perhaps documentation is all that's needed.

package main

import (
        "fmt"

        "github.com/segmentio/conf"
)

type config struct {
        Name string `conf:"name" help:"set me please"`
}

func main() {
        c := config{}
        conf.Load(&c)
        fmt.Println(c)
}
abraithwaite at alan-mbpr in ~GOPATH/src/github.com/segmentio
10:57:05 $ go run play.go -name null
{}
@achille-roussel
Copy link
Contributor

It does indeed.

Was your expectation that the name would be set to the string null?

@abraithwaite
Copy link
Contributor Author

For flags at least yeah. Maybe this is also related to the other issue with : in env vars and cli args?

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

2 participants