Thanks Ian. It came as a pleasant surprise that using statically compiled executable reduced(!) runtime memory usage by a noticeable portion. And gladly, till now the components are behaving well.
Kind regards, Howard On Tuesday, 7 November 2017 16:23:17 UTC+1, Ian Lance Taylor wrote: > > On Tue, Nov 7, 2017 at 1:28 AM, Howard Guo <guoh...@gmail.com > <javascript:>> wrote: > > Just noticed this statement from src/net/net.go: > > > > ------------------ > > On Unix systems, the resolver has two options for resolving names. > > It can use a pure Go resolver that sends DNS requests directly to the > > servers > > listed in /etc/resolv.conf, or it can use a cgo-based resolver that > calls C > > library routines such as getaddrinfo and getnameinfo. > > ----------------- > > > > However, using its recommended method to force usage of Go resolver > still > > results in a dynamic binary: > > > > export GODEBUG=netdns=go > > Setting the GODEBUG environment variable changes the behavior at run > time. It does not affect how the program is built. > > As you've seen setting CGO_ENABLED=0 is a quick way to ensure that you > get a static binary with no C code. But this does mean that the > os/user package, and less frequently the net package, will not behave > correctly in certain environments. If you are running in a Docker > container or otherwise constrained environment this does not matter. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.