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

validate

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package validate provides small, generic request validators for MCP tools.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("empty value")

ErrEmpty is wrapped with the field name when a required value is blank.

View Source
var ErrZero = errors.New("zero value")

ErrZero is wrapped with the field name when a required value is the zero T.

Functions

func RequireNonEmpty

func RequireNonEmpty(field, value string) error

RequireNonEmpty wraps ErrEmpty, naming field, when value is blank (trimmed).

func RequireNonZero

func RequireNonZero[T comparable](field string, value T) error

RequireNonZero wraps ErrZero, naming field, when value is the zero of T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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