Skip to content

Membership validation #313

@alexyans

Description

@alexyans

As of v9, i don't see a way to validate a struct field that can only take values from a restricted set of possible values. This is meant to act as a replacement for sum types (enums).

Example use case: Making sure that User.Gender can take values within []string{"male", "female", "n/a"}

Any suggestions?

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions