3 ms·
Go is only statically linked when not depending on C code, if you're using CGo, you cannot get a statically linked executable with Go alone, and a lot of Go pro
by kristoff_it 4y ago
Go is only statically linked when not depending on C code, if you're using CGo, you cannot get a statically linked executable with Go alone, and a lot of Go projects do depend on C code. You also lose Go's cross-compilation when using CGo.
In fact, Zig is used in combination with CGo to create statically linked executables and re-enable cross-compilation:
https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho https://dev.to/kristoff/zig-makes-go-cross-compilation-just-...
Same also applies to Rust:
https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work/ https://actually.fyi/posts/zig-makes-rust-cross-compilation-...
> It's still a good idea to Dockerize your apps even if they are statically compiled. If your app has C dependencies e.g. libxml2, it won't run on another system if the required C headers are missing.
You clearly don't understand the meaning of statically linked nor how dynamic linking works. Spend less time concern-trolling and more learning software engineering, friend ;^)
- _gerald_ 4y ago[flagged]