Has an Option.Default field been considered? I prefer to write options without struct tags (since struct tags aren't checked by the compiler, leading to my issue yesterday), but right now you need to write the following:
{
Names: []string{"count"},
Description: "The (maximum) number of logs to request.",
Placeholder: "<num>",
Decoder: writ.NewDefaulter(writ.NewOptionDecoder(config.Count), "1"),
},
This isn't bad, but it:
- Limits you to strings - if the field is an
int64 or other time (say, for Unix timestamps) then you can't set a default.
- A
Default field would be more explicit and would better map against the existing struct tag names.
Has an
Option.Defaultfield been considered? I prefer to write options without struct tags (since struct tags aren't checked by the compiler, leading to my issue yesterday), but right now you need to write the following:{ Names: []string{"count"}, Description: "The (maximum) number of logs to request.", Placeholder: "<num>", Decoder: writ.NewDefaulter(writ.NewOptionDecoder(config.Count), "1"), },This isn't bad, but it:
int64or other time (say, for Unix timestamps) then you can't set a default.Defaultfield would be more explicit and would better map against the existing struct tag names.