Running a single Go file

You don't have to build a file and get an executable if you only want to run it. The go run option allows you to run the .go file without leaving an executable behind. You can still pass in arguments as if it was a regular executable, like this:

go run example.go arg1 arg2

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.