Skip to content

Commit

Permalink
Leverage (*Imports).LookupType when generating interface field getters (
Browse files Browse the repository at this point in the history
#2315)

Co-authored-by: Bill Rose <neptoess@gmail.com>
  • Loading branch information
neptoess and Bill Rose committed Aug 5, 2022
1 parent 242c3ba commit f5d6032
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/modelgen/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (m *Plugin) MutateConfig(cfg *config.Config) error {
return ""
}

getter := fmt.Sprintf("func (this %s) Get%s() %s { return ", templates.ToGo(model.Name), field.GoName, field.Type.String())
getter := fmt.Sprintf("func (this %s) Get%s() %s { return ", templates.ToGo(model.Name), field.GoName, templates.CurrentImports.LookupType(field.Type))
_, interfaceFieldTypeIsPointer := field.Type.(*types.Pointer)
var structFieldTypeIsPointer bool
for _, f := range model.Fields {
Expand Down

0 comments on commit f5d6032

Please sign in to comment.