Go Development and Execution Environment: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 13: Line 13:
go env GOPATH
go env GOPATH
</syntaxhighlight>
</syntaxhighlight>
For documentation on GOPATH, execute:
For documentation on <code>GOPATH</code>, execute:
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
go help gopath
go help gopath

Revision as of 19:04, 7 September 2023

Internal

Overview

The go Tool

go is a tool used to manage source code. More details:

go

Environment Variables

GOPATH

The GOPATH environment variable defines the workspace directory. Go tools assume that your code is under the path designated by GOPATH. Used to search for packages during compilation, when packages are being imported.

To display the value, as seen by the Go runtime, execute:

go env GOPATH

For documentation on GOPATH, execute:

go help gopath

GOROOT

Used to search for packages during compilation, when packages are being imported. To display the value, as seen by the Go runtime, execute:

go env GOROOT

Compilation

go build

Execution

go run

TODO

Deplete, merge and delete Go Concepts - Runtime