Closed chrismarget-j closed 1 month ago
This:
_ enum = new(PortRole) PortRoleAccess = PortRole{Value: "access"} PortRoleGeneric = PortRole{Value: "generic"} PortRoleLeaf = PortRole{Value: "leaf"} PortRolePeer = PortRole{Value: "peer"} PortRoleSpine = PortRole{Value: "spine"} PortRoleSuperspine = PortRole{Value: "superspine"} PortRoleUnused = PortRole{Value: "unused"} PortRoles = oenum.New( PortRoleAccess, PortRoleGeneric, PortRoleLeaf, PortRolePeer, PortRoleSpine, PortRoleSuperspine, PortRoleUnused, ) type PortRole oenum.Member[string] func (o PortRole) String() string { return o.Value } func (o *PortRole) FromString(s string) error { t := PortRoles.Parse(s) if t == nil { return newEnumParseError(o, s) } o.Value = t.Value return nil
This: