-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Hey, I haven't found any way to generate struct based enums that can be used to avoid assigning incorrect values to variables of enum type. I guess this could be a useful improvement, what do you think?
The example of enum I'm talking about:
type Role struct {
slug string
}
func (r Role) String() string {
return r.slug
}
var (
Unknown = Role{""}
Guest = Role{"guest"}
Member = Role{"member"}
Moderator = Role{"moderator"}
Admin = Role{"admin"}
)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels