uber-go / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
1.85k stars 106 forks source link

feat: `mockgen` flag `--build_constraint` to add `//go:build` directives #191

Open ARR4N opened 1 week ago

ARR4N commented 1 week ago

Resolves #190

Note that //go:generate has unusual handling of flags with spaces so the quotes have to include the flag name (example) for complex constraints. This revealed a bug in --write_generate_directive, which just prints space-delimited os.Args.

The workaround of using --copyright_file is neither viable (it adds a space between // and go:build) nor good practice as overloading functionality can result in bugs due to unanticipated usage (e.g. the aforementioned space).

CLAassistant commented 1 week ago

CLA assistant check
All committers have signed the CLA.