I just started playing around with the Go programming language with a view to eventually be able to understand/author code than can be used to pentest websites.
A small compiler tip I learnt while writing my first program
go build win2.go
Note the size of the generated binary.

Adding the -w -s flags
go build -w -s win2.go

There is a significant reduction in the binary size. Quoting from Black Hat Go – Having a smaller binary will make it more efficient to transfer or embed while pursuing your nefarious endeavors. 😉
The book goes on to say “By default, the produced binary file contains debugging information and the symbol table. This can bloat the size of
the file. To reduce the file size, you can include additional
flags during the build process to strip this information from the
binary.“
Lets look at the tradeoff – losing the ability to perform runtime debugging using gdb.
Without the flags.

With the flags

REFERENCES
- Black Hat Go – Steele et. al. (Chapter 1)
Leave a comment