2 ms·
> That's not exactly fair. The entire point of this exercise is to move away from C code, by implementing it in a memory safe language (Go). Ok, I'll go along
by gunapologist99 5y ago
> That's not exactly fair. The entire point of this exercise is to move away from C code, by implementing it in a memory safe language (Go).
Ok, I'll go along with that, but being memory safe is no panacea either.
> Go is statically compiled
As soon as you use os or net, you're almost certainly dynamically compiled unless you take deliberate steps not to be. (You can check your final binary with ldd to see if it's dynamic or not.)
Here's a few things you should do to be sure you're compiling statically:
CGO_ENABLED=0 go build -tags osusergo,netgo
Also, you can't use the race detector or explicitly C libraries like SQLite. And, be careful -- if you use CGO and try to compile statically, then you might end up including glibc.