form

package module
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: AGPL-3.0 Imports: 9 Imported by: 11

README

Form

Open in Gitpod

A Go library for building HTML forms with a fluent API, validation, theming, HTMX integration, and grid layouts.

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). You can find a copy of the license at https://www.gnu.org/licenses/agpl-3.0.en.html

For commercial use, please use my contact page to obtain a commercial license.

Installation

go get github.com/dracory/form

Quick Start

import "github.com/dracory/form"

f := form.New().
    WithID("contactForm").
    WithFields(
        form.NewStringField("name", "Full Name").WithRequired(),
        form.NewEmailField("email", "Email").WithPlaceholder("you@example.com"),
    )

html := f.Build().ToHTML()

Documentation

  • Field Types - All 18 supported field types and their constructors
  • Fluent API - Form and Field builder methods for chaining
  • Validation - 13 built-in validators, custom validators, inline error display
  • Theming - Bootstrap 5, Tailwind CSS, and custom themes
  • HTMX Integration - Simple attributes and structured HTMXConfig
  • Field Rows - Grid layouts with multi-column rows
  • Repeater - Dynamic add/remove field groups
  • Test Helpers - Assertion helpers for testing forms
  • Advanced - Trumbowyg WYSIWYG config, legacy API

Documentation

Index

Constants

View Source
const FORM_FIELD_TYPE_BLOCKEDITOR = "blockeditor"
View Source
const FORM_FIELD_TYPE_CHECKBOX = "checkbox"
View Source
const FORM_FIELD_TYPE_COLOR = "color"
View Source
const FORM_FIELD_TYPE_DATE = "date"
View Source
const FORM_FIELD_TYPE_DATETIME = "datetime"
View Source
const FORM_FIELD_TYPE_EMAIL = "email"
View Source
const FORM_FIELD_TYPE_FILE = "file"
View Source
const FORM_FIELD_TYPE_HIDDEN = "hidden"
View Source
const FORM_FIELD_TYPE_HTMLAREA = "htmlarea"
View Source
const FORM_FIELD_TYPE_IMAGE = "image"
View Source
const FORM_FIELD_TYPE_NUMBER = "number"
View Source
const FORM_FIELD_TYPE_PASSWORD = "password"
View Source
const FORM_FIELD_TYPE_RADIO = "radio"
View Source
const FORM_FIELD_TYPE_RAW = "raw"
View Source
const FORM_FIELD_TYPE_SELECT = "select"
View Source
const FORM_FIELD_TYPE_STRING = "string"
View Source
const FORM_FIELD_TYPE_TABLE = "table"
View Source
const FORM_FIELD_TYPE_TEL = "tel"
View Source
const FORM_FIELD_TYPE_TEXTAREA = "textarea"
View Source
const FORM_FIELD_TYPE_URL = "url"

Variables

This section is empty.

Functions

func AssertFieldContains added in v0.20.0

func AssertFieldContains(t *testing.T, field FieldInterface, expected string)

AssertFieldContains checks that the rendered field HTML contains the expected string.

func AssertFieldNotContains added in v0.20.0

func AssertFieldNotContains(t *testing.T, field FieldInterface, unexpected string)

AssertFieldNotContains checks that the rendered field HTML does NOT contain the given string.

func AssertFormContains added in v0.20.0

func AssertFormContains(t *testing.T, form *Form, expected string)

AssertFormContains checks that the rendered form HTML contains the expected string. It calls t.Helper() so the test failure points to the caller.

func AssertFormNotContains added in v0.20.0

func AssertFormNotContains(t *testing.T, form *Form, unexpected string)

AssertFormNotContains checks that the rendered form HTML does NOT contain the given string.

func AssertValidationErrorCount added in v0.20.0

func AssertValidationErrorCount(t *testing.T, form *Form, values map[string]string, expectedCount int)

AssertValidationErrorCount checks that validation produces exactly n errors.

func AssertValidationFailsOn added in v0.20.0

func AssertValidationFailsOn(t *testing.T, form *Form, values map[string]string, fieldName string)

AssertValidationFailsOn checks that validation fails specifically on the named field.

func AssertValidationPasses added in v0.20.0

func AssertValidationPasses(t *testing.T, form *Form, values map[string]string)

AssertValidationPasses checks that the form validation passes for the given values.

func NewFieldRow added in v0.20.0

func NewFieldRow(fields ...FieldInterface) *fieldRow

NewFieldRow creates a row of fields. Each field gets an equal-width column by default.

func NewFieldRowWithColumns added in v0.20.0

func NewFieldRowWithColumns(columns ...FieldRowColumn) *fieldRow

NewFieldRowWithColumns creates a row with explicit column configurations.

func NewRepeater

func NewRepeater(opts RepeaterOptions) *fieldRepeater

NewRepeater creates a new repeater field that allows adding and removing groups of fields.

Types

type Field

type Field struct {
	ID           string // automatic, if not assigned
	Type         string
	Name         string
	Label        string
	Help         string
	Options      []FieldOption
	OptionsF     func() []FieldOption
	Value        string
	Required     bool
	Readonly     bool
	Disabled     bool
	TableOptions TableOptions
	// BlockEditorOptions BlockEditorOptions
	Placeholder string
	Invisible   bool
	CustomInput hb.TagInterface
	Attrs       map[string]string
	Multiple    bool
	Validators  []Validator
	// contains filtered or unexported fields
}

Field represents a single form field with its configuration, value, and rendering options.

func NewCheckboxField added in v0.20.0

func NewCheckboxField(name, label string) *Field

NewCheckboxField creates a new checkbox field with the given name and label.

func NewColorField added in v0.20.0

func NewColorField(name, label string) *Field

NewColorField creates a new color picker field with the given name and label.

func NewDateField added in v0.20.0

func NewDateField(name, label string) *Field

NewDateField creates a new date input field with the given name and label.

func NewDateTimeField added in v0.20.0

func NewDateTimeField(name, label string) *Field

NewDateTimeField creates a new datetime input field with the given name and label.

func NewEmailField added in v0.20.0

func NewEmailField(name, label string) *Field

NewEmailField creates a new email input field with the given name and label.

func NewField

func NewField(opts FieldOptions) *Field

NewField creates a new Field with the given options.

func NewFileField added in v0.20.0

func NewFileField(name, label string) *Field

NewFileField creates a new file upload field with the given name and label.

func NewHiddenField added in v0.20.0

func NewHiddenField(name, value string) *Field

NewHiddenField creates a new hidden input field with the given name and value.

func NewHtmlAreaField added in v0.20.0

func NewHtmlAreaField(name, label string) *Field

NewHtmlAreaField creates a new HTML area (WYSIWYG) field with the given name and label.

func NewImageField added in v0.20.0

func NewImageField(name, label string) *Field

NewImageField creates a new image field with the given name and label.

func NewNumberField added in v0.20.0

func NewNumberField(name, label string) *Field

NewNumberField creates a new number input field with the given name and label.

func NewPasswordField added in v0.20.0

func NewPasswordField(name, label string) *Field

NewPasswordField creates a new password input field with the given name and label.

func NewRadioField added in v0.20.0

func NewRadioField(name, label string, options []FieldOption) *Field

NewRadioField creates a new radio button group with the given name, label, and options.

func NewRawField added in v0.20.0

func NewRawField(value string) *Field

NewRawField creates a new raw HTML field with the given value (rendered as-is).

func NewSelectField added in v0.20.0

func NewSelectField(name, label string, options []FieldOption) *Field

NewSelectField creates a new select field with the given name, label, and options.

func NewStringField added in v0.20.0

func NewStringField(name, label string) *Field

NewStringField creates a new text input field with the given name and label.

func NewTelField added in v0.20.0

func NewTelField(name, label string) *Field

NewTelField creates a new telephone input field with the given name and label.

func NewTextAreaField added in v0.20.0

func NewTextAreaField(name, label string) *Field

NewTextAreaField creates a new textarea field with the given name and label.

func NewURLField added in v0.20.0

func NewURLField(name, label string) *Field

NewURLField creates a new URL input field with the given name and label.

func (*Field) BuildFormGroup

func (field *Field) BuildFormGroup(fileManagerURL string) *hb.Tag

BuildFormGroup builds the complete form group HTML element for this field, including label, input, help text, and any required indicators.

func (*Field) GetHelp

func (field *Field) GetHelp() string

func (*Field) GetID

func (field *Field) GetID() string

func (*Field) GetLabel

func (field *Field) GetLabel() string

func (*Field) GetName

func (field *Field) GetName() string

func (*Field) GetOptions

func (field *Field) GetOptions() []FieldOption

func (*Field) GetOptionsF

func (field *Field) GetOptionsF() func() []FieldOption

func (*Field) GetRequired

func (field *Field) GetRequired() bool

func (*Field) GetType

func (field *Field) GetType() string

func (*Field) GetValue

func (field *Field) GetValue() string

func (*Field) IsBlockEditor

func (field *Field) IsBlockEditor() bool

func (*Field) IsCheckbox added in v0.20.0

func (field *Field) IsCheckbox() bool

func (*Field) IsColor added in v0.20.0

func (field *Field) IsColor() bool

func (*Field) IsDate

func (field *Field) IsDate() bool

func (*Field) IsDateTime

func (field *Field) IsDateTime() bool

func (*Field) IsDisabled

func (field *Field) IsDisabled() bool

func (*Field) IsEmail added in v0.20.0

func (field *Field) IsEmail() bool

func (*Field) IsFile added in v0.20.0

func (field *Field) IsFile() bool

func (*Field) IsHidden

func (field *Field) IsHidden() bool

func (*Field) IsHtmlArea

func (field *Field) IsHtmlArea() bool

func (*Field) IsImage

func (field *Field) IsImage() bool

func (*Field) IsNumber

func (field *Field) IsNumber() bool

func (*Field) IsPassword

func (field *Field) IsPassword() bool

func (*Field) IsRadio added in v0.20.0

func (field *Field) IsRadio() bool

func (*Field) IsRaw

func (field *Field) IsRaw() bool

func (*Field) IsReadonly

func (field *Field) IsReadonly() bool

func (*Field) IsRequired

func (field *Field) IsRequired() bool

func (*Field) IsSelect

func (field *Field) IsSelect() bool

func (*Field) IsString

func (field *Field) IsString() bool

func (*Field) IsTable

func (field *Field) IsTable() bool

func (*Field) IsTel added in v0.20.0

func (field *Field) IsTel() bool

func (*Field) IsTextArea

func (field *Field) IsTextArea() bool

func (*Field) IsUrl added in v0.20.0

func (field *Field) IsUrl() bool

func (*Field) SetHelp

func (field *Field) SetHelp(fieldHelp string)

func (*Field) SetID

func (field *Field) SetID(fieldID string)

func (*Field) SetLabel

func (field *Field) SetLabel(fieldLabel string)

func (*Field) SetName

func (field *Field) SetName(fieldName string)

func (*Field) SetOptions

func (field *Field) SetOptions(fieldOptions []FieldOption)

func (*Field) SetOptionsF

func (field *Field) SetOptionsF(fieldOptionsF func() []FieldOption)

func (*Field) SetRequired

func (field *Field) SetRequired(fieldRequired bool)

func (*Field) SetType

func (field *Field) SetType(fieldType string)

func (*Field) SetValue

func (field *Field) SetValue(fieldValue string)

func (*Field) TrumbowygScript

func (field *Field) TrumbowygScript() string

TrumbowygScript returns the JavaScript code to initialize the Trumbowyg WYSIWYG editor for this field, using either the provided config option or a default configuration.

func (*Field) WithAttr added in v0.20.0

func (field *Field) WithAttr(key, value string) *Field

WithAttr sets a single custom HTML attribute on the field's input element.

func (*Field) WithAttrs added in v0.20.0

func (field *Field) WithAttrs(attrs map[string]string) *Field

WithAttrs sets multiple custom HTML attributes on the field's input element.

func (*Field) WithCustomInput added in v0.20.0

func (field *Field) WithCustomInput(input hb.TagInterface) *Field

WithCustomInput sets a custom hb.Tag to use as the input element.

func (*Field) WithDisabled added in v0.20.0

func (field *Field) WithDisabled() *Field

WithDisabled marks the field as disabled.

func (*Field) WithHelp added in v0.20.0

func (field *Field) WithHelp(help string) *Field

WithHelp sets the field's help text displayed below the input.

func (*Field) WithID added in v0.20.0

func (field *Field) WithID(id string) *Field

WithID sets the field's HTML id attribute.

func (*Field) WithInvisible added in v0.20.0

func (field *Field) WithInvisible() *Field

WithInvisible marks the field as invisible (hidden via CSS).

func (*Field) WithLabel added in v0.20.0

func (field *Field) WithLabel(label string) *Field

WithLabel sets the field's label text.

func (*Field) WithMultiple added in v0.20.0

func (field *Field) WithMultiple() *Field

WithMultiple enables multi-select on select fields.

func (*Field) WithName added in v0.20.0

func (field *Field) WithName(name string) *Field

WithName sets the field's name attribute.

func (*Field) WithOptions added in v0.20.0

func (field *Field) WithOptions(options ...FieldOption) *Field

WithOptions sets the field's static options (for select, radio, etc.).

func (*Field) WithOptionsF added in v0.20.0

func (field *Field) WithOptionsF(optionsF func() []FieldOption) *Field

WithOptionsF sets a dynamic options provider function.

func (*Field) WithPlaceholder added in v0.20.0

func (field *Field) WithPlaceholder(placeholder string) *Field

WithPlaceholder sets the field's placeholder text.

func (*Field) WithReadonly added in v0.20.0

func (field *Field) WithReadonly() *Field

WithReadonly marks the field as readonly.

func (*Field) WithRequired added in v0.20.0

func (field *Field) WithRequired() *Field

WithRequired marks the field as required.

func (*Field) WithTableOptions added in v0.20.0

func (field *Field) WithTableOptions(opts TableOptions) *Field

WithTableOptions sets the table options for table-type fields.

func (*Field) WithType added in v0.20.0

func (field *Field) WithType(fieldType string) *Field

WithType sets the field's type.

func (*Field) WithValidators added in v0.20.0

func (field *Field) WithValidators(validators ...Validator) *Field

WithValidators sets the field's validators.

func (*Field) WithValue added in v0.20.0

func (field *Field) WithValue(value string) *Field

WithValue sets the field's value.

type FieldInterface

type FieldInterface interface {
	GetID() string
	SetID(fieldID string)
	GetLabel() string
	SetLabel(fieldLabel string)
	GetName() string
	SetName(fieldName string)
	GetHelp() string
	SetHelp(fieldName string)
	GetOptions() []FieldOption
	SetOptions(fieldOptions []FieldOption)
	GetOptionsF() func() []FieldOption
	SetOptionsF(fieldOptionsF func() []FieldOption)
	GetRequired() bool
	SetRequired(fieldRequired bool)
	GetType() string
	SetType(fieldType string)
	GetValue() string
	SetValue(fieldValue string)
	BuildFormGroup(fileManagerURL string) *hb.Tag
	// contains filtered or unexported methods
}

FieldInterface defines the contract that all form field types must implement.

type FieldOption

type FieldOption struct {
	Key   string
	Value string
}

FieldOption represents a key-value pair used for select, radio, and other option-based fields.

type FieldOptions

type FieldOptions struct {
	ID           string // automatic, if not assigned
	Type         string
	Name         string
	Label        string
	Help         string
	Options      []FieldOption
	OptionsF     func() []FieldOption
	Value        string
	Required     bool
	Readonly     bool
	Disabled     bool
	TableOptions TableOptions
	Placeholder  string
	Invisible    bool
	CustomInput  hb.TagInterface
	Attrs        map[string]string
	Multiple     bool
	Validators   []Validator
}

FieldOptions configures a new Field instance.

type FieldRowColumn added in v0.20.0

type FieldRowColumn struct {
	Field    FieldInterface
	ColClass string // e.g. "col-md-6", "col-4". Empty = auto equal width ("col")
}

FieldRowColumn represents a single column in a field row with its field and optional CSS class.

type Form

type Form struct {
	// contains filtered or unexported fields
}

Form represents an HTML form with fields, styling, and optional HTMX integration.

func New added in v0.20.0

func New() *Form

New creates a new empty Form with POST as the default method. Use the With* methods to configure it via chaining.

func NewForm

func NewForm(opts FormOptions) *Form

NewForm creates a new Form with the given options. Defaults to POST method if not specified.

func (*Form) AddField

func (form *Form) AddField(field FieldInterface)

AddField appends a field to the form.

func (*Form) Build

func (form *Form) Build() *hb.Tag

Build renders the form and all its fields into an hb.Tag HTML element.

func (*Form) GetErrors added in v0.20.0

func (form *Form) GetErrors() map[string]string

GetErrors returns the current validation error messages.

func (*Form) GetFields

func (form *Form) GetFields() []FieldInterface

GetFields returns all fields in the form.

func (*Form) GetFileManagerURL

func (form *Form) GetFileManagerURL() string

GetFileManagerURL returns the file manager URL used for image fields.

func (*Form) SetErrors added in v0.20.0

func (form *Form) SetErrors(errors map[string]string)

SetErrors sets the validation error messages to display inline next to fields. The map keys are field names, values are error messages.

func (*Form) SetFields

func (form *Form) SetFields(fields []FieldInterface)

SetFields replaces all fields in the form.

func (*Form) SetFileManagerURL

func (form *Form) SetFileManagerURL(url string)

SetFileManagerURL sets the file manager URL used for image fields.

func (*Form) Validate added in v0.20.0

func (form *Form) Validate(values map[string]string) []ValidationError

Validate validates the given values against the form fields and their validators. It returns a slice of ValidationError. An empty slice means validation passed. Errors are also stored on the form for inline display when Build() is called.

func (*Form) WithAction added in v0.20.0

func (form *Form) WithAction(actionURL string) *Form

WithAction sets the form's action URL.

func (*Form) WithClass added in v0.20.0

func (form *Form) WithClass(className string) *Form

WithClass sets the form's CSS class.

func (*Form) WithErrors added in v0.20.0

func (form *Form) WithErrors(errors map[string]string) *Form

WithErrors sets validation error messages to display inline next to fields. The map keys are field names, values are error messages.

func (*Form) WithFields added in v0.20.0

func (form *Form) WithFields(fields ...FieldInterface) *Form

WithFields sets the form's fields.

func (*Form) WithFileManager added in v0.20.0

func (form *Form) WithFileManager(url string) *Form

WithFileManager sets the file manager URL used for image fields.

func (*Form) WithHTMX added in v0.20.0

func (form *Form) WithHTMX(config HTMXConfig) *Form

WithHTMX sets HTMX attributes on the form using a structured config. This provides access to extended HTMX attributes beyond Post/Target/Swap.

func (*Form) WithHxPost added in v0.20.0

func (form *Form) WithHxPost(url string) *Form

WithHxPost sets the hx-post attribute for HTMX integration.

func (*Form) WithHxSwap added in v0.20.0

func (form *Form) WithHxSwap(swap string) *Form

WithHxSwap sets the hx-swap attribute for HTMX integration.

func (*Form) WithHxTarget added in v0.20.0

func (form *Form) WithHxTarget(target string) *Form

WithHxTarget sets the hx-target attribute for HTMX integration.

func (*Form) WithID added in v0.20.0

func (form *Form) WithID(id string) *Form

WithID sets the form's HTML id attribute.

func (*Form) WithMethod added in v0.20.0

func (form *Form) WithMethod(method string) *Form

WithMethod sets the form's HTTP method.

func (*Form) WithTheme added in v0.20.0

func (form *Form) WithTheme(theme *Theme) *Form

WithTheme sets the theme used for rendering form fields.

type FormOptions

type FormOptions struct {
	ActionURL      string           // optional
	ClassName      string           // optional
	ID             string           // optional
	Fields         []FieldInterface // optional
	FileManagerURL string           // optional
	Method         string           // optional

	// HTMX helpers
	HxPost   string // optional
	HxTarget string // optional
	HxSwap   string // optional

}

FormOptions configures a new Form instance.

type HTMXConfig added in v0.20.0

type HTMXConfig struct {
	Post        string // hx-post URL
	Get         string // hx-get URL
	Target      string // hx-target selector
	Swap        string // hx-swap method
	Trigger     string // hx-trigger event
	Indicator   string // hx-indicator selector
	Confirm     string // hx-confirm message
	Sync        string // hx-sync strategy
	Validate    bool   // hx-validate
	DisabledElt string // hx-disabled-elt selector
	Encoding    string // hx-encoding (e.g. "multipart/form-data")
	PushURL     string // hx-push-url
}

HTMXConfig provides a structured way to configure HTMX attributes on a form.

type RepeaterOptions

type RepeaterOptions struct {
	Label               string
	Type                string
	Name                string
	Value               string
	Help                string
	Fields              []FieldInterface
	Values              []map[string]string
	RepeaterAddUrl      string
	RepeaterMoveUpUrl   string
	RepeaterMoveDownUrl string
	RepeaterRemoveUrl   string
}

RepeaterOptions configures a new repeater field instance.

type TableColumn

type TableColumn struct {
	Label string
	Width int
}

TableColumn represents a column header in a table field.

type TableOptions

type TableOptions struct {
	Header          []TableColumn
	Rows            [][]Field
	RowAddButton    *hb.Tag
	RowDeleteButton *hb.Tag
}

TableOptions configures the layout and behavior of a table field.

type Theme added in v0.20.0

type Theme struct {
	FormGroupClass     string
	LabelClass         string
	InputClass         string
	SelectClass        string
	TextAreaClass      string
	CheckboxWrapClass  string
	CheckboxInputClass string
	RadioWrapClass     string
	RadioInputClass    string
	RadioLabelClass    string
	FileInputClass     string
	HelpClass          string
	RequiredClass      string
	RequiredMarker     string
	TableClass         string
	ErrorClass         string // CSS class for the error message element
	ErrorInputClass    string // CSS class added to invalid inputs
}

Theme defines the CSS classes used when rendering form fields. This allows decoupling from any specific CSS framework.

func ThemeBootstrap5 added in v0.20.0

func ThemeBootstrap5() *Theme

ThemeBootstrap5 returns the default Bootstrap 5 theme.

func ThemeTailwind added in v0.20.0

func ThemeTailwind() *Theme

ThemeTailwind returns a Tailwind CSS theme.

type ValidationError added in v0.20.0

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a single validation error for a field.

func AssertValidationFails added in v0.20.0

func AssertValidationFails(t *testing.T, form *Form, values map[string]string) []ValidationError

AssertValidationFails checks that the form validation fails for the given values. It returns the validation errors for further inspection.

type Validator added in v0.20.0

type Validator func(fieldName string, value string) *ValidationError

Validator is a function that validates a field value and returns an error message if invalid.

func ValidatorAlphaNumeric added in v0.20.0

func ValidatorAlphaNumeric() Validator

ValidatorAlphaNumeric returns a validator that checks if a value contains only letters and numbers.

func ValidatorCustom added in v0.20.0

func ValidatorCustom(fn func(value string) string) Validator

ValidatorCustom returns a validator that uses a custom function. The function receives the value and returns an error message if invalid, or empty string if valid.

func ValidatorEmail added in v0.20.0

func ValidatorEmail() Validator

ValidatorEmail returns a validator that checks if a value is a valid email address.

func ValidatorIP added in v0.20.0

func ValidatorIP() Validator

ValidatorIP returns a validator that checks if a value is a valid IPv4 address.

func ValidatorMax added in v0.20.0

func ValidatorMax(max float64) Validator

ValidatorMax returns a validator that checks if a numeric value is at most max.

func ValidatorMaxLength added in v0.20.0

func ValidatorMaxLength(maxLength int) Validator

ValidatorMaxLength returns a validator that checks if a value has at most maxLength characters.

func ValidatorMin added in v0.20.0

func ValidatorMin(min float64) Validator

ValidatorMin returns a validator that checks if a numeric value is at least min.

func ValidatorMinLength added in v0.20.0

func ValidatorMinLength(minLength int) Validator

ValidatorMinLength returns a validator that checks if a value has at least minLength characters.

func ValidatorOneOf added in v0.20.0

func ValidatorOneOf(allowed ...string) Validator

ValidatorOneOf returns a validator that checks if a value is one of the allowed values.

func ValidatorPattern added in v0.20.0

func ValidatorPattern(pattern string, message string) Validator

ValidatorPattern returns a validator that checks if a value matches a regex pattern.

func ValidatorRequired added in v0.20.0

func ValidatorRequired() Validator

ValidatorRequired returns a validator that checks if a value is non-empty.

func ValidatorURL added in v0.20.0

func ValidatorURL() Validator

ValidatorURL returns a validator that checks if a value is a valid URL.

func ValidatorUUID added in v0.20.0

func ValidatorUUID() Validator

ValidatorUUID returns a validator that checks if a value is a valid UUID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL