OSS TanbouSign in with GitHub

validate fields, cross-field relationships, and nested collections with Go struct tags

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
20,194
Primary language
Go
License
MIT
Repository last updated
Oct 5, 2026
On this page

Overview

go-playground/validator validates Go structs and fields through tags. It supports single-field rules, cross-field and cross-struct checks, slice, array, and map diving, key/value validation, custom types, alias tags, and internationalized validation errors.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Declare field and cross-field validation rules through struct tags

Built-in tags cover required values, ranges, network and string formats, while cross-field and cross-struct rules validate relationships between values.

Sources: [2]

Dive into collections and combine custom validators with translated errors

Nested slices and maps can be validated recursively, including map keys and values, alongside custom field types, alias tags, extracted field names, and locale-aware error translation.

Sources: [2]

Best fit

Fits Go backends that want shared validation for request DTOs and domain inputs

It is useful for API requests, configuration inputs, and command objects where repeated validation branches should be centralized. It is also the default validator used by Gin.

Sources: [2]

Before adoption

v10.30.5 requires Go 1.26 and required-struct behavior is expected to change by default in v11

The v10.30.5 go.mod declares Go 1.26, and the release adds Go 1.27 support while fixing signed integer fields in port validation. The README recommends WithRequiredStructEnabled, which is planned to become the default in v11+, so regression-test zero-value structs and nested validation before upgrading.

Sources: [3][2][4]

Official sources

  1. [1]go-playground/validator — GitHub repository(2026-10-06)
  2. [2]Validator v10.30.5 — README(2026-10-06)
  3. [3]Validator v10.30.5 — go.mod(2026-10-06)
  4. [4]Validator v10.30.5 release(2026-10-06)
  5. [5]Validator MIT license(2026-10-06)
Supplemental curator note

Validator centralizes request DTO and domain-input validation around tags and custom rules. Because required-struct behavior is expected to become the default in v11, new integrations should consider enabling WithRequiredStructEnabled now.

Try it in 3 steps

  1. 1

    Get the source

    git clone --depth 1 https://github.com/go-playground/validator.git
  2. 2

    Enter the repository

    cd validator
  3. 3

    Check the official steps

    Continue with the commands in the README Installation, Quick Start, or Getting Started section.

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Check the official README

Growth

Growth trends · Last 30 days

20,194 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
12
Open PRs
101

Development activity is still being collected.

Built with

Categories and tags

Tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • validation
  • translation
  • error-handling
Stars
20,194
Forks
1,472
Watchers
124
Open issues
240
Contributors
260
Owner type
Organization
Primary language
Go
License
MIT
Repository last updated
Oct 5, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?