【文件属性】:
文件名称:validations:去验证
文件大小:7KB
文件格式:ZIP
更新时间:2021-07-14 21:19:15
Go
验证
去验证
安装
go get github.com/ernestoalejo/validations
API参考
例子
验证字符串、电子邮件和整数
package main
import (
vals "github.com/ernestoalejo/validations"
)
type requestData struct {
Foo string
FooEmail string
Bar int
}
func ( req * requestData ) Validate () error {
return vals . Run ([]vals. Func {
vals . Str ( req . Foo , []vals. StrFunc {
vals . Required (),
}),
vals . Str ( req
【文件预览】:
validations-master
----validation.go(248B)
----time.go(1KB)
----struct.go(678B)
----slice.go(2KB)
----if.go(367B)
----LICENSE(1KB)
----doc.go(228B)
----README.md(2KB)
----integer64.go(1KB)
----string.go(2KB)
----integer.go(945B)
----float.go(856B)