Merge pull request #93 from danw/docptrs
docs: Allow propery structs to contain non-struct ptrs
diff --git a/bootstrap/bpdoc/bpdoc.go b/bootstrap/bpdoc/bpdoc.go
index d4b52a5..f96d37e 100644
--- a/bootstrap/bpdoc/bpdoc.go
+++ b/bootstrap/bpdoc/bpdoc.go
@@ -501,13 +501,11 @@
}
elem = elem.Elem()
}
- if elem.Kind() != reflect.Struct {
- panic(fmt.Errorf("can't get type of field %q: points to a "+
- "non-struct", field.Name))
+ if elem.Kind() == reflect.Struct {
+ nestPoint := prefix + proptools.PropertyNameForField(field.Name)
+ ret[nestPoint] = elem
+ walk(elem, nestPoint+".")
}
- nestPoint := prefix + proptools.PropertyNameForField(field.Name)
- ret[nestPoint] = elem
- walk(elem, nestPoint+".")
}
default:
panic(fmt.Errorf("unexpected kind for property struct field %q: %s",