-
-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Description
Defining an enum like so enum:"a,b," allows these values: "a", "b", and "".
It doesn’t seem possible to set the default to empty string, however. The following program wouldn’t run:
type program struct {
Flag string `enum:"a,b," default:""`
}panic: program.Flag: enum value is only valid if it is either required or has a valid default value
Playground: https://go.dev/play/p/x5OERlVyu-J
Metadata
Metadata
Assignees
Labels
No labels