Hacker News new | ask | show | jobs
by car54whereareu 4879 days ago
Actually if you import "net" go links to libc.so and some others.
2 comments

I believe "net" does so for native dns lookups. You can disable that by building go with 'CGO_ENABLED=0', if desired.
That is correct. It uses libc for resolving names because systems might be configured to use NIS or LDAP before DNS. With cgo disabled it defaults to using its own DNS resolver and resolv.conf.
Ah, if the original bulletpoints for go are wrong then ghc may be more comparable than I figured. Can you statically link go binaries? As in, if I am using a go postgresql binding, can I build a binary with libpq (the postgresql C library) linked in statically, so it can be deployed on servers with no postgresql libraries installed?
From what I understand cgo doesn't currently support static linking like this.