3 ms·
Actually if you import "net" go links to libc.so and some others.
by car54whereareu 14y ago
Actually if you import "net" go links to libc.so and some others.
- stock_toaster 14y agoI believe "net" does so for native dns lookups. You can disable that by building go with 'CGO_ENABLED=0', if desired.
- 4ad 14y agoThat 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.
- papsosouid 14y agoAh, 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?
- cdoxsey 14y agoFrom what I understand cgo doesn't currently support static linking like this.