# go-validator/validator

Package validator implements struct field validations

Repository: https://github.com/go-validator/validator
Canonical: https://ross.abutalabs.com/products/go-validator-validator
Language: Go
License: Apache-2.0
License Family: permissive
Last push: 2022-04-05T14:57:29+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4509, "days_push": 1611, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1332, forks 124 (observed 2026-08-28T04:04:24.452444+00:00)

## What it is
A Go library that validates struct fields via struct tags, with built-in validators like min, max, len, nonzero, nonnil, and regexp, plus support for custom validation functions. It is the older gopkg.in/validator.v2 package, now largely superseded by go-playground/validator.

## Use cases
- validate struct fields in go with tags
- validate incoming api request payloads in go
- check string length and regex constraints on go structs
- add custom validation rules to go structs
- validate form input before saving to database

## When to choose
- you maintain a legacy codebase already using gopkg.in/validator.v2
- you want a small, simple tag-based struct validator with minimal dependencies

## When to avoid
- starting a new Go project - go-playground/validator is more feature-rich and actively maintained
- you need nested struct validation, cross-field rules, or rich error messages

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, developer-tools
- domain: developer-tools, backend, web-development
- platform: go, cross-platform
- tags: struct-validation, input-validation, go-library, form-validation

## Member repositories
- go-validator/validator (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:24.452444+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:45:11.528106+00:00, confidence not recorded.
  - readme: https://github.com/go-validator/validator (fetched 2026-08-28T04:04:24.452444+00:00, sha 98dcfedd8434)
- Data as of 2026-08-30T08:39:29.467469+00:00.
