protoc-gen-validate icon indicating copy to clipboard operation
protoc-gen-validate copied to clipboard

Add an option to insert build tags into generated files

Open howardjohn opened this issue 1 year ago • 0 comments

Currently, validate.go functions make a substantial amount of our binary size, which we would like to reduce. In fact, we don't even call .Validate() at all in our code - so it is all wasted space.

It would be great to have the ability to add a build tag to the generated files. Then, libraries could insert a build: !disible-protoc-gen-validate or similar to allow opting out.


Note: the obvious question is "why not just NOT use the plugin?". The reason is we are depending on importing other's libraries (in this case, Envoy). We also cannot just generate our own protos instead of theirs, as there must be only 1 definition in the final compiled binary, and Envoy protos are used by tons of other dependencies.

howardjohn avatar Sep 16 '22 19:09 howardjohn