This is a created article in which the information may have evolved or changed.
go1.9.2 out, there is a tool written in Golang to compile, just test it. I was under the WINDOWS10 64-bit test. Compiling and executing files is almost as efficient. But 1.9.2 compiled the file 6M.
Personally think this is a bit big, the key is the function is not complex. So I think this volume is simply too exaggerated, try to lose weight.
Size compiled with the original build
6,167kb
The Build section parameters view the results by removing partial connections and debugging.
-A forces all dependent packages to be compiled.
-S Remove symbolic information
-W Remove dwarf debug information, the resulting program can not be debugged with GDB
S and W are not recommended for use at the same time.
Go build-ldflags-w test.go
But the volume is still a little big.
4,236kb
Finally, it is only the shell compression. The tool address is as follows:
Https://github.com/upx/upx/releases
Execute command
Upx.exe-9-K "Test.exe"
The volume after compression
1,372kb