mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
9 lines
186 B
Go
9 lines
186 B
Go
package dynamic
|
|
|
|
import "reflect"
|
|
|
|
func HasField(rs reflect.Value, fieldName string) (field reflect.Value, ok bool) {
|
|
field = rs.FieldByName(fieldName)
|
|
return field, field.IsValid()
|
|
}
|