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

Usage tag: Keep tag convention #5

Merged
merged 1 commit into from
May 10, 2017
Merged

Conversation

copitux
Copy link

@copitux copitux commented May 3, 2017

[conf.json]

{
    "foo_bar": "foo",
    "foo_nested": {
        "foo_bar": "fopo"
    }
}

[main.go]

type Config struct {
    FooBar string `usage:"foo" json:"foo_bar"`
    FooNested Nested `usage:"nested" json:"foo_nested"`
}

type Nested struct {
    FooBar string `usage:"foo" json:"foo_bar"`
}

func main() {
    c := &Config{}
    goconfig.Read(c)
    log.Printf("%#v\n",c)
}
$ go run main.go -h
  -config string
    	Configuration JSON file
  -foobar string
    	foo
  -foonested.foobar string
    	foo
$ go run main.go -config conf.json 
 &main.Config{FooBar:"foo", FooNested:main.Nested{FooBar:"foo"}}

@fulldump
Copy link
Owner

retest this please

@fulldump fulldump merged commit 81fe54b into fulldump:master May 10, 2017
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