Help us shape the future of Go! Take the 2026 Go Developer Survey

validator

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package validator runs struct-tag validation followed by custom validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Option

func Option() typedcfg.Option

Option enables validate struct tags. The core calls custom Validate separately.

func Validate

func Validate(v any) error

Validate runs go-playground/validator struct tags, then calls Validate on v when it implements Validator. It returns the first error.

Types

type Validator

type Validator interface {
	// Validate performs custom validation and returns an error if validation fails
	Validate() error
}

Validator supplies application-specific validation after tag validation succeeds.

Jump to

Keyboard shortcuts

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