Skip to content

Unify JSON/zflags tags? #9

Open
@justinbastress

Description

@justinbastress

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions