4 ms·
With a big footnote: Until you need CGO
by metaltyphoon 1y ago
With a big footnote: Until you need CGO
- fragmede 1y agofair.
- supriyo-biswas 1y agoHaving recently done some investigation along the same lines for a side project that I did not continue to work on: is it not just a matter of passing CGO_LDFLAGS=—static and building on musl?
- saagarjha 1y agoI don't think you can do this when targeting macOS
- metaltyphoon 1y agoor FreeBSD
- steveklabnik 1y agoTo say what your siblings said, but more generally: basically this only works for Linux. Other OSes generally don't let you do this, you must have some degree of dynamic linking. Go used to try and let you do it, but has walked back those implementations after all the bugs they've caused, in my understanding.