Skip to content

Commit

Permalink
always set metadata, so it's never nil
Browse files Browse the repository at this point in the history
  • Loading branch information
matryer committed Aug 31, 2020
1 parent 343c8f7 commit efd392a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ func (p *Parser) parseField(pkg *packages.Package, objectName string, v *types.V
f.Name = v.Name()
f.NameLowerCamel = camelizeDown(f.Name)
f.Comment = p.commentForField(objectName, f.Name)
f.Metadata = map[string]interface{}{}
if !v.Exported() {
return f, p.wrapErr(errors.New(f.Name+" must be exported"), pkg, v.Pos())
}
Expand Down Expand Up @@ -409,6 +410,7 @@ func (p *Parser) addOutputFields() error {
TypeName: "string",
JSType: "string",
},
Metadata: map[string]interface{}{},
}
for typeName := range p.outputObjects {
obj, err := p.def.Object(typeName)
Expand Down

0 comments on commit efd392a

Please sign in to comment.