struct: add comment about the if clause
This commit is contained in:
parent
bf7dff7189
commit
dc3312cb1a
@ -558,6 +558,7 @@ func (s *Struct) nested(val reflect.Value) interface{} {
|
|||||||
// TODO(arslan): should this be optional?
|
// TODO(arslan): should this be optional?
|
||||||
// do not iterate of non struct types, just pass the value. Ie: []int,
|
// do not iterate of non struct types, just pass the value. Ie: []int,
|
||||||
// []string, co... We only iterate further if it's a struct.
|
// []string, co... We only iterate further if it's a struct.
|
||||||
|
// i.e []foo or []*foo
|
||||||
if val.Type().Elem().Kind() != reflect.Struct &&
|
if val.Type().Elem().Kind() != reflect.Struct &&
|
||||||
!(val.Type().Elem().Kind() == reflect.Ptr &&
|
!(val.Type().Elem().Kind() == reflect.Ptr &&
|
||||||
val.Type().Elem().Elem().Kind() == reflect.Struct) {
|
val.Type().Elem().Elem().Kind() == reflect.Struct) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user