|
|
|
@ -156,6 +156,9 @@ const omitemptyPrefix = "__omitempty__" |
|
|
|
|
// validation validation information via context.Context.
|
|
|
|
|
func (v Validate) ValidateMapCtx(ctx context.Context, data map[string]interface{}, rules map[string]interface{}) map[string]interface{} { |
|
|
|
|
errs := make(map[string]interface{}) |
|
|
|
|
if len(data) == 0 { |
|
|
|
|
return errs |
|
|
|
|
} |
|
|
|
|
Loop: |
|
|
|
|
for field, rule := range rules { |
|
|
|
|
if strings.HasPrefix(field, omitemptyPrefix) == true { |
|
|
|
|