mock
mock copied to clipboard
How to write the mock result to a file in reflect mode
Actual behavior A clear and concise description of what the bug is.
Expected behavior A clear and concise description of what you expected to happen.
To Reproduce Steps to reproduce the behavior
- ...
- ...
Additional Information
- gomock mode (reflect or source):
- gomock version or git ref:
- golang version:
Triage Notes for the Maintainers
gomock mode (reflect or source): //go:generate mockgen . DecPooler type DecPooler interface { Pooler FreeToChan(msg *dto.DecMsg) //ε½θΏζΆζ―ε°ζ± εδΈ AllocFromChan() *dto.DecMsg //δ»ζ± εδΈει ζΆζ― } Is there any way to write the mock result to a file in reflect mode
Was looking for this as well, can't do something like > out.go in go:generate and -destination doesn't seem to be supported in reflect mode.
For writing the mock result to a file put the destination flag in the first place, like this
//go:generate mockgen -destination mock/resquest_test.go -package ${GOPACKAGE} some/package Request
package and interfaces always should be last