rjeczalik / interfaces

Code generation tools for Go.
MIT License
420 stars 31 forks source link

Bug in interfacer - no exported methods found for "Worktree" (package "github.com/go-git/go-git/v5_test") #30

Closed roi-codefresh closed 1 year ago

roi-codefresh commented 3 years ago

When using interfacer on github.com/go-git/go-git/v5.Worktree it failed inconsistently with:

no exported methods found for "Worktree" (package "github.com/go-git/go-git/v5_test")

I tried to debug interfacer and found out that it loads the definitions from this package in a random order and there are four definitions in this package with the name Worktree, two of those definitions have the type *types.Named so they pass this check, but only one of them has the type methods, which makes if fail if it takes the wrong definition.

I have implemented a fix and it seems to be working, I can submit a PR if you'd like.

roi-codefresh commented 3 years ago

submitted pr #31 for review