Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PermittedValue ¶
func PermittedValue[T comparable](value T, permittedValues ...T) bool
PermittedValue() returns true if a value is in a list of specific permitted values.
Types ¶
type Validator ¶
Define a new Validator struct which contains a map of validation error messages for our form fields.
func (*Validator) AddFieldError ¶
AddFieldError() adds an error message to the FieldErrors map (so long as no entry already exists for the given key).
func (*Validator) CheckField ¶
CheckField() adds an error message to the FieldErrors map only if a validation check is not 'ok'.
Click to show internal directories.
Click to hide internal directories.