Open mplachter opened 3 years ago
Added second commit can squash later.
First commit actually changed the default behavior of go build as it would either set CGO to be on or off where in the default it is only on for the binary if the system building it matches the build architecture and system.
Go by default will build with CGO enabled when building on native systems where it is expected to work. https://pkg.go.dev/cmd/cgo#:~:text=The%20cgo%20tool%20is%20enabled,to%200%20to%20disable%20it.
I would like to add a parameter flag which will disable CGO when building no matter if it could be supported natively.
This is useful when building artifacts that will not run on systems that will not have the c bindings present for example docker containers running binaries.