Go Development and Execution Environment

From NovaOrdis Knowledge Base
Revision as of 19:01, 7 September 2023 by Ovidiu (talk | contribs) (→‎GOPATH)
Jump to navigation Jump to search

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 exposed to the Go runtime, execute:

go env GOPATH

GOROOT

Used to search for packages during compilation, when packages are being imported.

Compilation

go build

Execution

go run

TODO

Deplete, merge and delete Go Concepts - Runtime