SkillAgentSearch skills...

Gova

validation tool of golang struct

Install / Use

/learn @tenntenn/Gova
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

#gova

It provides validation functions using struct tags.

##How to use?

import "github.com/tenntenn/gova"

type MyType struct {
	FirstName string `length:"20" pattern:"[A-Z][a-z]*"`
	LastName  string `length:"20" pattern:"[A-Z][a-z]*"`
	Email     string `email:"-"`
}

v1 := &MyType{"Hoge", "Fuga", "hogefuga@gmail.com"}
fmt.Println(gova.Validate(v1)) // return nil

v2 := &MyType{"Hoge", "Fuga", "hogefuga"}
fmt.Println(gova.Validate(v2)) // return error

LICENSE

http://www.wtfpl.net/txt/copying/

Related Skills

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated11y ago
Forks2

Languages

Go

Security Score

60/100

Audited on Feb 5, 2015

No findings