Skip to content
@go-ozzo

Ozzo Framework

Idiomatic Go libraries for web development: validation, routing, database, logging, config. Actively maintained.

go-ozzo

Idiomatic Go Libraries for Web Development
By Qiang Xue, creator of Yii Framework

Go Version License Status


Libraries

Library Purpose Version Stars Issues PRs
Data Validation
ozzo-validation Configurable validation using code, not struct tags
HTTP Routing
🌐 ozzo-routing Fast HTTP router with regex matching and RESTful API support
Database
🗄️ ozzo-dbx DB-agnostic query builder enhancing database/sql
Infrastructure
📝 ozzo-log High-performance async logging with severity filtering
⚙️ ozzo-config Layered config in JSON, YAML, TOML
💉 ozzo-di Dependency injection container

ozzo-validation

The flagship library. Validation using normal Go code instead of error-prone struct tags:

package main

import (
    "fmt"
    validation "github.com/go-ozzo/ozzo-validation/v4"
    "github.com/go-ozzo/ozzo-validation/v4/is"
)

type User struct {
    Name  string
    Email string
    Age   int
}

func (u User) Validate() error {
    return validation.ValidateStruct(&u,
        validation.Field(&u.Name, validation.Required, validation.Length(3, 50)),
        validation.Field(&u.Email, validation.Required, is.EmailFormat),
        validation.Field(&u.Age, validation.Required, validation.Min(18)),
    )
}

func main() {
    u := User{Name: "Jo", Email: "bad", Age: 10}
    fmt.Println(u.Validate())
    // Output: Age: must be no less than 18; Email: must be a valid email address;
    //         Name: the length must be between 3 and 50.
}

Why ozzo-validation over struct tags?

  • IDE autocomplete and compile-time checks
  • Complex conditional rules with When()
  • Custom validators with By()
  • Map validation without structs
  • Context-aware validation

Status

After being unmaintained since 2020, go-ozzo is actively maintained again as of July 2026.

What's happening:

  • Full review of all open PRs and issues completed
  • Bug fixes and community contributions being reviewed and merged
  • CI being modernized (GitHub Actions, golangci-lint, codecov)
  • New validation rules coming: UUID v7, ULID, and more

All improvements are additive and backward-compatible — no import path changes, no migration needed. Minimum Go version is being updated from 1.13 to 1.21+ (discussion).

See ozzo-validation#207 for the full roadmap and discussion.


Maintainers

Name Role
@qiangxue Creator, Yii Framework author
@kolkov Active maintainer, GoGPU author

Contributing

We welcome contributions! Start with:


License

All projects are licensed under the MIT License.


Idiomatic Go libraries for building better web applications
github.com/go-ozzo

Pinned Loading

  1. ozzo-validation ozzo-validation Public

    An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.

    Go 4.1k 244

  2. ozzo-dbx ozzo-dbx Public

    A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.

    Go 670 110

  3. ozzo-routing ozzo-routing Public

    An extremely fast Go (golang) HTTP router that supports regular expression route matching. Comes with full support for building RESTful APIs.

    Go 452 48

Repositories

Showing 7 of 7 repositories

Top languages

Loading…

Most used topics

Loading…