Skip to content

Commit

Permalink
Fix pagination bug caused by mutator
Browse files Browse the repository at this point in the history
Signed-off-by: Toby Yan <me@tobyan.com>
  • Loading branch information
toby1991 committed Jul 29, 2019
1 parent 2f7dc37 commit 97a27a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions model/base_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ func structReflect(reflectValue *reflect.Value, isGetter bool) {
//debug.Dump(reflectValue.Type().Elem().Kind().String(), reflectValue.Type(), reflectValue.Type().Elem())

wg := &sync.WaitGroup{}

//debug.Dump(reflectValue.Type(), reflectValue.CanAddr())

// change value to ptr
if reflectValue.CanAddr() && reflectValue.Kind() != reflect.Ptr {
tmp := reflectValue.Addr()
reflectValue = &tmp
}

for i := 0; i < reflectValue.Type().Elem().NumField(); i++ {
wg.Add(1)
go func(wg *sync.WaitGroup, index int) {
Expand Down

0 comments on commit 97a27a0

Please sign in to comment.