jerechua / validate

Simple Go struct validation library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Go struct validation library

This is a just for fun library to try out Go reflect library, tags and go get.

How to use

Simply add a validate tag as shown below

type MyStruct struct {
  RequiredInt int `validate:"required"`
  RequiredString  string `validate:"required"`
  OptionalVariable int
}

Future work?

  • Nested validation currently fails (Issue #1)
  • Email validation (Issue #2)

About

Simple Go struct validation library

License:MIT License


Languages

Language:Go 100.0%