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.
I often end up with code like this:
We could write a custom JSON processor that uses
longas the JSON field name whenjsonis not present, but it would probably be simpler to have zflags use thejsonfield iflongis not present.This could get us closer to allowing JSON/YAML config in addition to the INI format.