4 ms·
It's not just about overhead/performance. cgo-free means no need to set up a cross-compiler if targeting other devices. Just "go build" with the right GOARCH an
by anupcshan 4mo ago
It's not just about overhead/performance. cgo-free means no need to set up a cross-compiler if targeting other devices. Just "go build" with the right GOARCH and GOOS will let you compile a binary that will run on most devices.
- usrnm 4mo agoI'm pretty sure that C is a much better choice if you really care about binaries that run on most devices
- Ferret7446 4mo agoDepends on what you mean by "most". The cross compile story for Go is far superior to C for the platforms it supports.
- anupcshan 4mo agoThis project is for using Sqlite from Go code. It is not a general purpose replacement.
- dizhn 4mo agoStatic builds cannot have cgo too if I am not mistaken.
- agwa 4mo agoThe following go flags let you build statically-linked cgo binaries, provided that all the C libraries that you're using support static linking and don't call the NSS functions in glibc: -tags netgo,osusergo -linkmode external -extldflags -static I regularly compile (cross-compile, even) static Go binaries that use the cgo sqlite package. But it's certainly a lot simpler if you can avoid cgo.