test: command api
This commit is contained in:
@@ -31,8 +31,10 @@ var productionTypeStringValidator validator.Func = func(fl validator.FieldLevel)
|
||||
v, ok := fl.Field().Interface().(string)
|
||||
if ok {
|
||||
f := fl.Parent().FieldByName(fl.Param())
|
||||
if s, ok := f.Interface().(string); ok && (s == "SHIP" || s == "SCIENCE") && len(strings.TrimSpace(v)) == 0 {
|
||||
return false
|
||||
if f.String() == "SHIP" || f.String() == "SCIENCE" {
|
||||
if _, ok := util.ValidateTypeName(v); !ok {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user