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

Unify JSON/zflags tags? #9

Open
justinbastress opened this issue Jun 29, 2018 · 0 comments
Open

Unify JSON/zflags tags? #9

justinbastress opened this issue Jun 29, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@justinbastress
Copy link
Contributor

I often end up with code like this:

type MyFlags struct {
   Field1 string `long:"field1" json:"field1,omitempty"`
   Field2 int `long:"field2" json:"field2"`
   // ...
}

We could write a custom JSON processor that uses long as the JSON field name when json is not present, but it would probably be simpler to have zflags use the json field if long is not present.

This could get us closer to allowing JSON/YAML config in addition to the INI format.

@justinbastress justinbastress added the enhancement New feature or request label Jun 29, 2018
justinbastress added a commit that referenced this issue Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant