# asaskevich/govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs

Repository: https://github.com/asaskevich/govalidator
Canonical: https://ross.abutalabs.com/products/govalidator
Homepage: https://asaskevich.dev/projects/govalidator/
Language: Go
License: MIT
License Family: permissive
Topics: govalidator, go, validation, validation-library, sanitization
Last push: 2026-08-20T05:19:33+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 8, longevity 100
- inputs: {"age_days": 4457, "days_push": 13, "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 6205, forks 572 (observed 2026-08-28T04:09:39.962245+00:00)

## What it is
govalidator is a Go package providing validators and sanitizers for strings, numerics, slices, and structs, inspired by validator.js. It supports struct tag-based validation with options like requiring all fields to have validation tags by default.

## Use cases
- validate email addresses and other string formats in Go
- validate struct fields using struct tags
- sanitize user input strings
- require all struct fields to have validation rules
- validate API request payloads in Go services
- validate numeric ranges and slice contents

## When to choose
- you need battle-tested validation in Go with wide adoption (used by Kubernetes, Vault, Docker)
- you want struct tag-based declarative validation
- you need both validation and sanitization in one package

## When to avoid
- you need high-performance validation with zero reflection overhead
- you prefer a different validation API style like go-playground/validator
- your project is not written in Go

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

## Member repositories
- asaskevich/govalidator (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:39.962245+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-29T17:47:18.667412+00:00, confidence not recorded.
  - readme: https://github.com/asaskevich/govalidator (fetched 2026-08-28T04:09:39.962245+00:00, sha c59ba54cad59)
  - homepage: https://asaskevich.dev/projects/govalidator/ (fetched 2026-08-29T08:43:43.556239+00:00, sha a27535aa86c9)
  - site_page: https://asaskevich.dev/ (fetched 2026-08-29T08:43:43.558889+00:00, sha 2e86f2151228)
- Data as of 2026-08-30T08:39:29.467469+00:00.
