Currently if you want to generate an interface file and have it reside in the same package as things the interface might depend on then you end up with generated code that fails to compile because the code is trying to import itself.
For instance, you have a package called car and you have defined a type car.Tire in the car package. You also have a service implementation file like car.Car and you have a method like ChangeTire(tire Tire). You now want to create an interface file in the same package car and call this interface file intf.go. If you try to generate the interface for car.Car you will have an extra import to the car package and your interface will have the method ChangeTire(tire car.Tire). This will fail to compile.
I expect the interface file to not have the extra import and the method should be ChangeTire(tire Tire).
Currently if you want to generate an interface file and have it reside in the same package as things the interface might depend on then you end up with generated code that fails to compile because the code is trying to import itself.
For instance, you have a package called
car
and you have defined a typecar.Tire
in thecar
package. You also have a service implementation file likecar.Car
and you have a method likeChangeTire(tire Tire)
. You now want to create an interface file in the same packagecar
and call this interface fileintf.go
. If you try to generate the interface forcar.Car
you will have an extra import to thecar
package and your interface will have the methodChangeTire(tire car.Tire)
. This will fail to compile.I expect the interface file to not have the extra import and the method should be
ChangeTire(tire Tire)
.