package entity type BenefactorStatus string const ( BenefactorActiveStatus = BenefactorStatus("active") BenefactorInactiveStatus = BenefactorStatus("inactive") ) var BenefactorStatusStrings = map[BenefactorStatus]string{ BenefactorActiveStatus: "active", BenefactorInactiveStatus: "inactive", } func (b BenefactorStatus) IsValid() bool { _, ok := BenefactorStatusStrings[b] return ok }