Create a static binary with Go 1.4

(This sentence is a memorandum writing if it is wrong, please contact me)

The binary file created in Go language has the feature that everything is static linked and goes into one binary.

However, it seems that there is a problem that becomes dynamic link if you put "net" package from 1.4. (Confirmed in 1.4.1)

% file hoge
hoge: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
% ldd hoge
     linux-vdso.so.1 =>  (0x00007fff05dfe000)
     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8c690a000)
     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8c6544000)
     /lib64/ld-linux-x86-64.so.2 (0x00007fd8c6b30000)

It seems to be static binary unless you use "net".

このあたり and this Issue It is.

-a options seem to be going to now do not apply to the standard library.

So, what should I do?

For the time being is as follows: -installsuffix was able to generate a static binary by adding a.

% go build -installsuffix .

It does not follow all the discussion, even without such a strange way いいようになる sounds too good with.