3 ms·
1) A lot of CI pipelines already do it by utilizing ldflags in go-build command. I don't think if few kilobytes more will matter much. 2): It will not be added
by pqb 5y ago
1) A lot of CI pipelines already do it by utilizing ldflags in go-build command. I don't think if few kilobytes more will matter much.
2): It will not be added (based on information provided in the article [0]).
3): Is it valid question? By my basic understanding of article the case of adding more bytes to binary will require having the main package [0]. Also, generation (e.g. gogo-proto, go:generate) will create only business logic code in new package, no additional metadata will be added.
[0] Quote from article:
> Version control information is embedded if the go command is invoked in a directory within a Git or Mercurial repository, and the main package and its containing main module are in the same repository.