gonum
gonum copied to clipboard
Cannot marshal JSON when enum has zero value
Blows up here when enum has zero value
// Description returns the enum description if present. If no description is defined an empty string is returned
func (g PublishedState) Description() string {
switch g {
case PublishedStatePrivate:
return ""
case PublishedStatePublished:
return ""
case PublishedStateUnderReview:
return ""
default:
panic("Could not map enum description")
}
}