We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey!
When I do go generate ./... I get an error.
go generate ./...
package main //go:generate moq -out mocks/some_iface.go . SomeIface type SomeIface interface { Begin() BeginFunc() }
Error: Type '*SomeIfaceMock' has both field and method named 'BeginFunc'
Type '*SomeIfaceMock' has both field and method named 'BeginFunc'
The text was updated successfully, but these errors were encountered:
Moq creates ___Func versions of the fields, so this clashes. As a workaround, you could name the field differently?
___Func
Sorry, something went wrong.
As a workaround, you could name the field differently?
I want to moq the pgx.Pool, https://github.com/jackc/pgx/blob/v4.15.0/pgxpool/conn.go#L83
I cannot name the field differently, except to make my own wrapper. Can we add some checks when generating the code?
I think @aleksvdim has a valid point here. I see to following options to resolve this:
moq -suffix MoqFunc
____MoqFunc
MoqFunc
No branches or pull requests
Hey!
When I do
go generate ./...
I get an error.Error:
Type '*SomeIfaceMock' has both field and method named 'BeginFunc'
The text was updated successfully, but these errors were encountered: