Skip to content

feat: add single file processing support for mock generation with -source flag#32

Closed
tomMoulard wants to merge 2 commits into
traefik:masterfrom
tomMoulard:feat/single-file-mode
Closed

feat: add single file processing support for mock generation with -source flag#32
tomMoulard wants to merge 2 commits into
traefik:masterfrom
tomMoulard:feat/single-file-mode

Conversation

@tomMoulard

@tomMoulard tomMoulard commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

When running mocktail, it can be cumbersome to regenerate all generated mock implementation.

This PR adds a new flag to the CLI to allow the generation of mocks for all interfaces in a file.

It can be used like so:

//go:generate mocktail -source=interfaces.go

Disclaimer

I know this is not a perfect implementation of the idea, and that it does not follow the common mocktail comments. I will not be mad if it is not incorporated in the repo as is.
But I think it's a nice way to use the tool, and we do not need to traverse the whole module, go:generate already does that for us.

@tomMoulard tomMoulard force-pushed the feat/single-file-mode branch 3 times, most recently from df7910e to 5e25ae0 Compare June 30, 2025 21:57
@tomMoulard tomMoulard force-pushed the feat/single-file-mode branch from 5e25ae0 to 7720663 Compare June 30, 2025 22:00
@tomMoulard tomMoulard closed this Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant