Skip to content

Commit

Permalink
added types.Unalias call
Browse files Browse the repository at this point in the history
  • Loading branch information
tulzke committed Sep 9, 2024
1 parent 703a35f commit 02bca6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mockgen/import_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (p *importModeParser) extractInterfacesFromPackage(pkg *packages.Package, i
}

func (p *importModeParser) parseInterface(obj types.Object) (*model.Interface, error) {
named, ok := obj.Type().(*types.Named)
named, ok := types.Unalias(obj.Type()).(*types.Named)
if !ok {
return nil, fmt.Errorf("%s is not an interface. it is a %s", obj.Name(), obj.Type().Underlying().String())
}
Expand Down

0 comments on commit 02bca6a

Please sign in to comment.