Closed jmaeso closed 3 years ago
Thanks for the report. It looks like more work needs to be done onto the changes that were made in #520. I think those changes assume that the const is defined locally. I would be willing to accept a PR for this issue.
Actual behavior
generating code for the following interface makes the tool to panic.
(Note: math constant used just for convenience. Can be any other package-defined constant, not a hardcoded value)
Output:
panic: interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.BasicLit
Expected behavior
Generate a mocked struct with a method that takes a
[127]string{}
(or[math.MaxInt8]string{}
) arrayTo Reproduce Steps to reproduce the behavior Explained in the "Actual behaviour" section
Additional Information
Triage Notes for the Maintainers