Registry / utility / go-playground-validator-v9

go-playground-validator-v9

JSON →
library9.31.0gogounverified

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

go get gopkg.in/go-playground/validator.v9
INSTALL
IMPORT
SIG · GO-PLAYGROUND-VALI
G
go-playground-validator-v9
utilitygov9.31.0
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
gopkg.in/go-playground/validator.v9

Validate a struct using tags.

package main import ( "fmt" "gopkg.in/go-playground/validator.v9" ) type User struct { Name string `validate:"required"` Email string `validate:"required,email"` } func main() { v := validator.New() user := User{Name: "John", Email: "john@example.com"} err := v.Struct(user) if err != nil { fmt.Println(err) } }
Debug
Known issues
breakingv9 is outdated; consider upgrading to v10 (github.com/go-playground/validator/v10) for new features and fixes.
fix
Update import to github.com/go-playground/validator/v10.
affects: >=9.0.0 <10.0.0
Upgrade
Version history
9.31.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

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