mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
dynamic: invert if
Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
parent
b15e8d0ce4
commit
903d773025
|
@ -24,7 +24,11 @@ func MergeStructValues(dst, src interface{}) {
|
|||
}
|
||||
|
||||
// if there is a field with the same name
|
||||
if fieldSrcType, ok := srcStructType.FieldByName(fieldName); ok {
|
||||
fieldSrcType, found := srcStructType.FieldByName(fieldName)
|
||||
if !found {
|
||||
continue
|
||||
}
|
||||
|
||||
// ensure that the type is the same
|
||||
if fieldSrcType.Type == fieldType.Type {
|
||||
srcValue := reflect.ValueOf(src).Elem().FieldByName(fieldName)
|
||||
|
@ -34,5 +38,4 @@ func MergeStructValues(dst, src interface{}) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user