You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
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.
Fixes#561 - Panic on array parsing if length is externally defined
It also fixes the following minor problems in TestParseArrayWithConstLength, a test function related to this feature.
It doesn't check all outputs to be asserted.
It doesn't initialize some of the fields in mockgen.fileParser, even though they are initialized in the production code. (Actually, it caused an unnecessary test error by test data I added)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 MaintainersThe text was updated successfully, but these errors were encountered: