Go Memory Management
Spoilers for why the simpler program is different: It doesn't do networking, which means  it doesn't use any cgo. The networking stack by default links against libc, but if you don't use it, your go program doesn't have to link against libc.You can always configure the CGO_ENABLED or -tags netgo flag in order to cause networking to not use libc  either.