Ignore required field if struct already has a default value
kotyara85 opened this issue · comments
Konstantin commented
Hello,
Does kong support autoignore errors if struct field has required flag and already has a value?
type Config struct {
AppName string `kong:"required"`
}
func main() {
cfg := Config{}
cfg.AppName = "test"
kong.Parse(&cfg) will result into error -app-name flag is not set
}
Thanks
Alec Thomas commented
No, Kong initialises the structure to zeroes/defaults.