3 ms·
So fun fact: if you use CGO, your binary effectively ends up with two versions of libc. It statically compiles musl into the binary itself for Go code and it dy
by slaymaker1907 5y ago
So fun fact: if you use CGO, your binary effectively ends up with two versions of libc. It statically compiles musl into the binary itself for Go code and it dynamically links in libc for any C code. I'm not sure why there isn't an option with CGO to skip statically linking musl. You're depending on the platform libc regardless and at least then you end up with a smaller binary.
- terinjokes 5y agoCitation needed? Go makes system calls directly for its runtime, then yes you'll get a libc for CGO, but musl isn't involved in the former.