WIP: set jail properties

This commit is contained in:
yo
2022-04-02 17:12:51 +02:00
parent 5a3d26a52c
commit 239bcd4b95
2 changed files with 47 additions and 7 deletions

View File

@ -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 {