Пример #1
0
func init() {
	createValidator = valid.New(&valid.Config{TagName: ValidatorTag})
	updateValidator = valid.New(&valid.Config{TagName: ValidatorTag})

	createValidator.RegisterValidation("enum", enum)
	createValidator.RegisterValidation("fixed", fake)
	createValidator.RegisterValidation("zerotime", zerotime)
	updateValidator.RegisterValidation("enum", enum)
	updateValidator.RegisterValidation("fixed", fixed)
	updateValidator.RegisterValidation("zerotime", zerotime)
}
Пример #2
0
func init() {
	validate = validator.New(&validator.Config{TagName: "validate"})
}