uber-go / mock

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

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

Closed ARR4N closed 1 month ago

ARR4N commented 4 months 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 4 months ago

CLA assistant check
All committers have signed the CLA.

jaceee commented 2 months ago

is this getting reviewed/merged any time soon?

Gris87 commented 2 months ago

Hi, we need this functionality too. When we can get it?