Golang gc: Difference between revisions

From wikinotes
(Created page with "This page documents the builtin golang compilation tools. = run = <blockquote> <code>go run</code> will build and run an executable. <blockquote> <syntaxhighlight lang="bash"> go run . # compile package at cwd, and run it's 'main()' method go run . --help # cli params for the program can be passed to go run go run main.go lib.go ... # compile only these files, and run detected 'main()' method go run some/package # compile a specific pa...")
 
Line 5: Line 5:
<code>go run</code> will build and run an executable.
<code>go run</code> will build and run an executable.


<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
go run .                  # compile package at cwd, and run it's 'main()' method
go run .                  # compile package at cwd, and run it's 'main()' method

Revision as of 01:03, 19 June 2022

This page documents the builtin golang compilation tools.

run

go run will build and run an executable.

go run .                  # compile package at cwd, and run it's 'main()' method
go run . --help           # cli params for the program can be passed to go run

go run main.go lib.go ... # compile only these files, and run detected 'main()' method
go run some/package       # compile a specific package

build

clean

install