forked from golang/mock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix parse array with the external const correctly (golang#569)
Fixes golang#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)
- Loading branch information
Showing
4 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package const_length | ||
|
||
import "math" | ||
|
||
//go:generate mockgen -package const_length -destination mock.go -source input.go | ||
|
||
const C = 2 | ||
|
||
type I interface { | ||
Foo() [C]int | ||
Bar() [2]int | ||
Baz() [math.MaxInt8]int | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters