lang: types, core: Skip over invalid functions
It's not clear how best to support complex functions with struct fields in templates at the moment. Skip these for now.
This commit is contained in:
@@ -899,6 +899,11 @@ func (obj *Type) Reflect() reflect.Type {
|
||||
if t == nil {
|
||||
panic("malformed struct field")
|
||||
}
|
||||
if strings.Title(k) != k { // is exported?
|
||||
//k = strings.Title(k) // TODO: is this helpful?
|
||||
// reflect.StructOf would panic on anything unexported
|
||||
panic(fmt.Sprintf("struct has unexported field: %s", k))
|
||||
}
|
||||
|
||||
fields = append(fields, reflect.StructField{
|
||||
Name: k, // struct field name
|
||||
|
||||
Reference in New Issue
Block a user