golang: Allow users to specify desired buildflags
+ 9
- 1
For example one could want to build the software with race detector, e.g.
[gowork]
...
buildflags = -race
or if you want to build a plugin for fluent-bit
[gowork]
...
install = your.package.import.path
buildflags = -buildmode=c-shared
and then your package will be installed as shared library into
${gowork:directory}/pkg/`go env GOOS`_`go env GOARCH`/<your.package.import.path>.a
One could pass that location explicitly to fluentd-bit -e ...
or
symlink to it from some .so from global directory of fluent-bit plugins.
Maybe it is not very good to use go install
for building plugins
(instead of go build -o ...
) but we anyway need to have ability to
specify buildflags as a generic feature, hence this patch.
/cc @Sokhoyan
Hi @Sokhoyan. Could you please provide whether the patch is working for you? (I've made it in blind mode so the patch was completely untested on my side).
Thanks beforehand,
Kirill
mentioned in commit 831271a2
Status changed to merged
@Sokhoyan, thanks for feedback. I've applied the patch to master.
Files with large changes are collapsed by default.