1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 02:20:19 +00:00
This commit is contained in:
miraclesu
2013-07-21 23:46:18 +08:00
parent 6d05163c9f
commit d19de30d9c
3 changed files with 229 additions and 7 deletions

View File

@ -72,7 +72,7 @@ func (r *ValidationResult) Message(message string, args ...interface{}) *Validat
if len(args) == 0 {
r.Error.Message = message
} else {
r.Error.Message = fmt.Sprintf(message, args)
r.Error.Message = fmt.Sprintf(message, args...)
}
}
return r
@ -107,15 +107,15 @@ func (v *Validation) Length(obj interface{}, n int, key string) *ValidationResul
return v.apply(Length{n, key}, obj)
}
func (v *Validation) Alpha(obj interface{}, n int, key string) *ValidationResult {
func (v *Validation) Alpha(obj interface{}, key string) *ValidationResult {
return v.apply(Alpha{key}, obj)
}
func (v *Validation) Numeric(obj interface{}, n int, key string) *ValidationResult {
func (v *Validation) Numeric(obj interface{}, key string) *ValidationResult {
return v.apply(Numeric{key}, obj)
}
func (v *Validation) AlphaNumeric(obj interface{}, n int, key string) *ValidationResult {
func (v *Validation) AlphaNumeric(obj interface{}, key string) *ValidationResult {
return v.apply(AlphaNumeric{key}, obj)
}