Skip to content

Commit

Permalink
[FIX]Modify range map to range sorted mapKey slice
Browse files Browse the repository at this point in the history
  • Loading branch information
4822 committed Nov 9, 2018
1 parent 41a40a8 commit 5a5ca89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validator.go
Expand Up @@ -551,7 +551,7 @@ func (v *Validate) tranverseStruct(topStruct reflect.Value, currentStruct reflec
if first || ct == nil || ct.typeof != typeStructOnly {

//By hxmhlt @2018.11.9
// Modify range map to range sorted mapKey slice for sorting the struct field , promise my custom validation call ordered to make it compatible with some mock library such as gp-sqlmock
// Modify range map to range sorted mapKey slice for sorting the struct field , promise my custom validation call ordered to make it compatible with some mock library such as go-sqlmock
var keys []int
for k := range cs.fields {
keys = append(keys, k)
Expand Down

0 comments on commit 5a5ca89

Please sign in to comment.