Registry / utility / go-playground-validator-v10

go-playground-validator-v10

JSON →
library10.30.3gogounverified

Package validator implements value validations for structs and individual fields based on tags.

go get github.com/go-playground/validator/v10
INSTALL
IMPORT
SIG · GO-PLAYGROUND-VALI
G
go-playground-validator-v10
utilitygov10.30.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

validator
github.com/go-playground/validator/v10

Validate a struct using tags.

package main import ( "fmt" "github.com/go-playground/validator/v10" ) type User struct { Name string `validate:"required"` Age int `validate:"gte=0,lte=130"` } func main() { validate := validator.New() user := User{Name: "", Age: 150} err := validate.Struct(user) if err != nil { fmt.Println(err) } }
Debug
Known issues
breakingVersion 10 has breaking changes from v9, including import path and some validation rules.
fix
Use `github.com/go-playground/validator/v10` and update validation tags accordingly.
affects: >=10.0.0
Upgrade
Version history
10.30.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
go-playground-validator-v10 — go get go-playground-validator-v10 · libregistry