mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
Merge pull request #650 from austin362667/fix/persistence
Fix: Persistence Reflect IsZero
This commit is contained in:
commit
47098b08dd
|
@ -92,6 +92,10 @@ func iterateFieldsByTag(obj interface{}, tagName string, cb StructFieldIterator)
|
|||
sv := reflect.ValueOf(obj)
|
||||
st := reflect.TypeOf(obj)
|
||||
|
||||
if sv.IsZero() {
|
||||
return nil
|
||||
}
|
||||
|
||||
if st.Kind() != reflect.Ptr {
|
||||
return fmt.Errorf("f needs to be a pointer of a struct, %s given", st)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user