Golang gc: Difference between revisions
From wikinotes
(→run) |
No edit summary |
||
Line 1: | Line 1: | ||
This page documents the builtin golang compilation tools. | This page documents the builtin golang compilation tools.<br> | ||
go's build/install/clean aim to replace the functionality of a Makefile. | |||
= run = | = run = |
Revision as of 01:09, 19 June 2022
This page documents the builtin golang compilation tools.
go's build/install/clean aim to replace the functionality of a Makefile.
run
go run
is a convenience tool that builds/runs 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 packageIt accepts all of the same build-flags as
go build
,
which includes some validation tools.go run -race . # compile/run, and detect race conditions