Open jeanschmitt opened 5 months ago
Hello,
Since v3.2.1, minimock generates import groups that don't compile, for interfaces importing types from other packages with the same name as the interface's package.
Consider this directory structure:
├── pb │ └── interface.go ├── dependency │ └── pb │ └── dep.go └── gen.go
With the following contents:
// dependency/pb/dep.go package pb type Item struct { A string }
// pb/interface.go package pb import ( "mymodule/dependency/pb" ) type Interface interface { A() pb.Item }
// gen.go package mymodule //go:generate minimock -i ./pb.Interface -g
import ( "mymodule/dependency/pb" mm_atomic "sync/atomic" mm_time "time" "github.com/gojuno/minimock/v3" )
import ( "mymodule/pb" "mymodule/dependency/pb" mm_atomic "sync/atomic" mm_time "time" "github.com/gojuno/minimock/v3" )
Which raises the error 'pb' redeclared as the imported package name
'pb' redeclared as the imported package name
Hey @jeanschmitt thanks for issue! I started another issue in gowrap https://github.com/hexdigest/gowrap/issues/87 as this bug is connected with gowrap update.
Hello,
Since v3.2.1, minimock generates import groups that don't compile, for interfaces importing types from other packages with the same name as the interface's package.
Steps to reproduce
Consider this directory structure:
With the following contents:
Generated import group in v3.2.0
Generated import group in v3.2.1
Which raises the error
'pb' redeclared as the imported package name