Currently, all release assets have debug info and they are uncompressed. I think it is very necessary to decrease the size of them. Here are some ways:
the original
your can see, the debug info of asset is not stripped, which size is 30M.
strip the debug info
Decreased by 7M, about 23% of the original size. And it is safe to strip the debug info when build . you can use go build -ldflags="-s -w" to achieve this goal. Just add -ldflags="-s -w" to azure pipeline file.
see also: https://golang.org/cmd/link/ to know the meaning of arguments above.
compress it
Only 6M, about 20% of the original size.
or use UPX to pack it
A standalone executable file only 7.2M, so fantastic!
Currently the release binaries aren't produced by the azure-pipelines.yml flow. I think Matt hand-rolls them for now while v2 is still in beta.
For the record, I think we need to keep debug info, so that panics and other stack traces contain useful information.
Edit: @Mohammed90 has pointed out to me that stripping debug symbols still preserves stack traces, so that's good.
For future reference, these are the links sources exchanged in our conversation:
https://dominik.honnef.co/posts/2016/10/go-and-strip/
https://groups.google.com/forum/#!topic/Golang-nuts/6K5Ca3GZF5k
Most helpful comment
Currently the release binaries aren't produced by the azure-pipelines.yml flow. I think Matt hand-rolls them for now while v2 is still in beta.