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 since July 2026.

Recent releases:

  • ozzo-validation v4.5.0 — restores the v4.3.0 behavior for empty values that v4.4.0 changed, adds errors.Is support and Flatten() for field errors, and an optional build without text/template
  • ozzo-routing v2.4.1 — security release, see GHSA-g7pf-jc4r-mx95; please upgrade
  • ozzo-dbx v1.7.0 — upsert for models and SQLite, locking reads (ForUpdate/ForShare), transaction and upsert fixes

What's happening:

  • Every repository is moving to the same standard: GitHub Actions CI on supported Go versions, race and 32-bit tests, strict linting, coverage, govulncheck, and the downstream test suites of real users before each release
  • ozzo-log, ozzo-config and ozzo-di are getting Go modules and their first tagged releases (v1.0.0)
  • Security issues can be reported privately through each repository's Security tab

Releases follow semantic versioning: no import path changes within a major version, and anything that changes existing behavior is called out in the changelog.


Star History

go-ozzo Ecosystem Star History

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.2k 246

  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 673 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 453 49

Repositories

Showing 7 of 7 repositories

Top languages

Loading…

Most used topics

Loading…