Cross compiling
Cross compiling is a feature that comes with Go and is very easy to use. It can be particularly useful if you are on a Linux machine performing a penetration test and you need to compile a custom reverse shell that will run on a Windows machine that you compromised.
You can target several architectures and operating systems, and all you need to do is modify an environment variable. There is no need for any extra tools or compilers. Everything is built in for Go.
Simply change the GOARCH and GOOS environment variables to match your desired build target. You can build for Windows, Mac, Linux, and more. You can also build for the prominent 32-bit and 64-bit desktop processors as well as ARM and MIPS for devices such as the Raspberry ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access