bbgo_origin/pkg/dynamic/field.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()
}