-
Notifications
You must be signed in to change notification settings - Fork 607
aux_files shouldn't be necessary in mockgen #181
Comments
I think this is close being done. The test in the package no longer needs |
I would love to hear from users here. The tests we currently have in the library that involve |
@codyoss I am currently having trouble making mocks of the Prometheus client package. I am trying to make a mock of the I am using Mockgen v1.4.4.
package prometheus
type Gauge interface {
Metric
Collector
}
package prometheus
type Metric interface {
Desc() *Desc
}
package prometheus
type Collector interface {
Desc() *Desc
} Failed commands:
Frustratingly, the second command previously gave a different failure message:
And adding the
I cannot repeat this! After thinking I was successful, I was setting up Makefile targets to refresh these mocks. After deleting all the mocks and trying the commands again, I only ever get this message from the above command:
|
@Botono I believe this case is now fixed, at least on HEAD. I believe all cases were aux_files was needed should now be gone. Unless I hear from users others I will deprecate this flag in the next release and make it a noop in the future. |
I'm struggling to resolve this issue.. Two interface in two different file but in same package. If I attempt to generate mock file from one interface which composite of the other, I got I'm using 1.6.0 btw |
Exactly the same situation as @intoxicated ... |
@intoxicated @mpyw This is fixed on HEAD. Please try with v1.7.0-rc.1 and let me know if you still have issues |
@codyoss i am trying to mock
output:
I am thinking the issue is because of type alias on another interface : https://github.com/uptrace/bun/blob/33503abd50f1dc349179a4470617a962f90b6948/bun.go#L16 how to fix? I am already using 1.7.0-rc.1 |
mockgen should try to load all the files in the package in source mode so the user shouldn't need to specify aux_file.
The text was updated successfully, but these errors were encountered: