by camus2 · 9y ago · 0 comments
Nitpick but hello-world in Go :
package main
func main(){
print("Hello World")
}
is < 1MB on most computers (900KB on windows). No need to import the "fmt" package."The print built-in function formats its arguments in an implementation-specific way and writes the result to standard error. Print is useful for bootstrapping and debugging; it is not guaranteed to stay in the language."
Debugging symbols are over 50% of most Go binaries I see, and you don't even need them to get stack traces from panics.
Combined with `upx --ultra-brute`, you can get static Go binaries down to about 12-15% of their plain `go build` size in my experience. (This also assumes CGO_ENABLED=0)