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

validation

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package validation provides ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAndConvert

func ValidateAndConvert[T Validator, U any](
	item T,
	converter func(T) U,
	itemType string,
) result.Result[U]

ValidateAndConvert provides a generic validation and conversion pattern Useful when you need to validate and then convert to a different type.

func ValidateAndWrap

func ValidateAndWrap[T Validator](item T, itemType string) result.Result[T]

ValidateAndWrap provides a generic validation wrapper that returns a Result[T] This eliminates duplicate validation patterns across the codebase.

func ValidateWithCustomError

func ValidateWithCustomError[T Validator](item T, errorMsg string) result.Result[T]

ValidateWithCustomError provides a generic validation wrapper with custom error message.

Types

type Validator

type Validator interface {
	Validate() error
}

Validator interface for types that can be validated.

Jump to

Keyboard shortcuts

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