2 ms·
I think the point is Go doesn't have C deps by default like Rust does.
by password4321 2y ago
I think the point is Go doesn't have C deps by default like Rust does.
- m0shen 2y agoI thought it depended on libc by default?
- mirashii 2y agoYou might find https://mt165.co.uk/blog/static-link-go/ https://mt165.co.uk/blog/static-link-go/ useful, but a quick tl;dr: Go binaries are statically linked by default if they do not call out to any C functions. Go will automatically switch to dynamic linking if you need to call out to C functions. There are some parts of the standard library that do this internally, and so many folks assume that go is dynamically linked by default.
- jeroenhd 2y agoAs I've found out trying to load a golang-built .so in an Alpine Python environment, Go makes many assumptions about the system it's running on, and one of them seems to be "if linux, then glibc". Something to do with environment variables being at a magical offset somewhere that caused a null dereference. Maybe it's been fixed since, but I wouldn't assume Go doesn't have any C dependencies.