On Sun, Aug 7, 2016 at 7:08 PM, Amit Saha <amitsaha...@gmail.com> wrote:
>
> From an old thread [1], I learned that CGO_ENABLED=0 will create static
> binaries for programs using the net/http package. I still see the same
> behavior as of go version go1.6.3 linux/amd64. Does this mean this is the
> only way to get statically linked binaries for programs using net/http?

It is a simple way that works.  Why do you want another way?

The issue is not actually the net/http package, it's the net package.
The net package is designed to fall back to the C library for DNS
lookups in some cases.  Setting CGO_ENABLED=0 disables that fallback,
and the net package will use pure Go code for DNS (which it does in
most cases anyhow).

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.

Reply via email to