{"id":52688,"library":"gobuffalo-validate","title":"Validate","description":"A validation library for Go structs and forms, part of the Buffalo ecosystem.","status":"active","version":"2.0.4+incompatible","language":"go","source_language":null,"source_url":"https://github.com/gobuffalo/validate","tags":["validation","forms","struct","buffalo","web"],"install":[{"cmd":"go get github.com/gobuffalo/validate","lang":"bash","label":"Install github.com/gobuffalo/validate"}],"dependencies":[],"imports":[{"symbol":"validate","correct":"github.com/gobuffalo/validate"}],"quickstart":{"code":"package main\n\nimport (\n\t\"github.com/gobuffalo/validate\"\n\t\"log\"\n)\n\ntype User struct {\n\tName string `json:\"name\"`\n\tAge  int    `json:\"age\"`\n}\n\nfunc (u *User) Validate() *validate.Errors {\n\terrors := validate.NewErrors()\n\tif u.Name == \"\" {\n\t\terrors.Add(\"name\", \"name is required\")\n\t}\n\tif u.Age < 0 {\n\t\terrors.Add(\"age\", \"age must be positive\")\n\t}\n\treturn errors\n}\n\nfunc main() {\n\tuser := User{Name: \"\", Age: -1}\n\terrors := user.Validate()\n\tif errors.HasAny() {\n\t\tlog.Println(errors.String())\n\t}\n}","lang":"go","description":"Define a struct with custom validation and check for errors."},"warnings":[{"fix":"Upgrade to the latest v3 version (github.com/gobuffalo/validate/v3).","message":"Version 2.0.4+incompatible indicates a pre-Go-modules release; use v3 or later for proper module support.","severity":"gotcha","affected_versions":"2.0.4+incompatible"}],"env_vars":null,"search_vec":"'buffalo':13,18 'ecosystem':14 'form':9,16 'go':6 'librari':4 'part':10 'struct':7,17 'valid':1,3,15 'web':19","created_at":"2026-06-15T07:07:28.696748+00:00","updated_at":"2026-06-15T07:07:28.696748+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/gobuffalo/validate","github":"https://github.com/gobuffalo/validate","docs":"https://pkg.go.dev/github.com/gobuffalo/validate#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}