▲ 2 ▼ Reduce Go Binary Size
Always a hot-topic in Go circles is binary size of applications. In this post we will show you how you can reduce the binary size produced from go build for leaner, slimer builds.
Register to comment or vote on this story
Awesome! Recently started using sqlite <> cgo and that's resulted in a fairly sizeable binary. Unsure if this will help much, but one to try out.
Another good tip to reduce binary size is to check if all the imports used are really needed. Just using a constant from a package also pulls in all its code. It would be great if Go could do some link time optimization to remove all unused parts of packages during compilation.