Run a main Go package

go run

  • Compile and run Go code without saving a binary.
    More information: <https://pkg.go.dev/cmd/go#hdr-Compile_and_run_Go_program>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

go run {{path/to/package}}

click the source code to copy install go run on any operating system with command-not-found.com