Go Development and Execution Environment: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
=Overview=
=Overview=
=The <tt>go</tt> Tool=
=The <tt>go</tt> Tool=
<code>go</code> is a tool used to manage source code. It has many commands.
<code>go</code> is a tool used to manage source code. More details: {{Internal|go_Tool#Overview|<tt>go</tt>}}


=Environment Variables=
=Environment Variables=
==<tt>GOPATH</tt>==
{{Internal|Go Environment Variables|Go Environment Variables}}
<FONT COLOR=DARKKHAKI>The <code>GOPATH</code> environment variable defines the [[Go_Language_Modularization#Workspaces|workspace]] directory. Go tools assume that your code is under the path designated by <code>GOPATH</code>. Used to search for packages during compilation, when packages are being [[Go_Language_Modularization#Importing_Packages|imported]].</font>
 
==<tt>GOROOT</tt>==
<font color=darkkhaki>Used to search for packages during compilation, when packages are being [[Go_Language_Modularization#Importing_Packages|imported]].</font>


=Compilation=
=Compilation=
{{Internal|Go_Tool#build|<tt>go build</tt>}}


=Execution=
=Execution=
<syntaxhighlight lang='bash'>
{{Internal|Go_Tool#run|<tt>go run</tt>}}
cd $PROJECT_DIR
go run ./src/main/main.go
</syntaxhighlight>


=TODO=
=TODO=
<font color=darkkhaki>Deplete, merge and delete [[Go Concepts - Runtime]]</font>
<font color=darkkhaki>Deplete, merge and delete [[Go Concepts - Runtime]]</font>

Latest revision as of 20:40, 7 September 2023

Internal

Overview

The go Tool

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

go

Environment Variables

Go Environment Variables

Compilation

go build

Execution

go run

TODO

Deplete, merge and delete Go Concepts - Runtime