Enum fields must be required or have a default.
This is a breaking change, but the previous behaviour was broken so I'm not concerned. Also made most programmer errors more useful by giving type.field context information. Fixes #179.
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ func TestMultipleConfigLoading(t *testing.T) {
|
||||
|
||||
func TestConfigValidation(t *testing.T) {
|
||||
var cli struct {
|
||||
Flag string `json:"flag,omitempty" enum:"valid"`
|
||||
Flag string `json:"flag,omitempty" enum:"valid" required:""`
|
||||
}
|
||||
|
||||
cli.Flag = "invalid"
|
||||
|
||||
Reference in New Issue
Block a user