Assuming you have these two files:
package foo
import (
pkg1 "github.com/user/pkg"
)
type FooStruct{}
func (f *FooStruct) One(pkg1.Foo) {
}
package foo
import (
pkg2 "github.com/user/pkg"
)
func (f *FooStruct) Two(pkg2.Foo) {
}
If you pass both files to ifacemaker, it will generate:
import (
pkg1 "github.com/user/pkg"
pkg2 "github.com/user/pkg"
)
type FooInterface {
One(pkg1.Foo)
Two(pkg2.Foo)
}
which is not valid because of the duplicate imports.
Similarly problematic are pkg1 "github.com/user/pkg" + "github.com/user/pkg" and even pkg "github.com/user/pkg" + "github.com/user/pkg".
I'm not sure if it's worth fixing this. The hardest part is probably finding an alias that doesn't conflict, after that, aliasing everything should be easier.
Assuming you have these two files:
If you pass both files to ifacemaker, it will generate:
which is not valid because of the duplicate imports.
Similarly problematic are
pkg1 "github.com/user/pkg"+"github.com/user/pkg"and evenpkg "github.com/user/pkg"+"github.com/user/pkg".I'm not sure if it's worth fixing this. The hardest part is probably finding an alias that doesn't conflict, after that, aliasing everything should be easier.