WIP: set jail properties
This commit is contained in:
13
cmd/utils.go
13
cmd/utils.go
@ -188,10 +188,11 @@ func getStructFieldNames(parentStruct interface{}, result []string, prefix strin
|
||||
func getStructFieldValue(parentStruct interface{}, fieldName string) (*reflect.Value, string, error) {
|
||||
v := reflect.ValueOf(parentStruct)
|
||||
|
||||
/* if v.Kind() == reflect.Ptr {
|
||||
* v = v.Elem()
|
||||
}
|
||||
*/
|
||||
if v.Kind() == reflect.Ptr {
|
||||
fmt.Printf("We got a pointer, get Elem form it\n")
|
||||
v = v.Elem()
|
||||
}
|
||||
|
||||
if false {
|
||||
for i := 0 ; i < v.NumField(); i++ {
|
||||
f := v.Field(i)
|
||||
@ -203,8 +204,8 @@ func getStructFieldValue(parentStruct interface{}, fieldName string) (*reflect.V
|
||||
|
||||
if strings.Contains(fieldName, ".") {
|
||||
fs := strings.Split(fieldName, ".")
|
||||
//f := v.FieldByName(fs[0])
|
||||
f := v.Elem().FieldByName(fs[0])
|
||||
f := v.FieldByName(fs[0])
|
||||
//f := v.Elem().FieldByName(fs[0])
|
||||
if f.Kind() == reflect.Struct {
|
||||
return getStructFieldValue(f.Interface(), strings.Join(fs[1:], "."))
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user