Go Tool: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
go build ./src/main/main.go
go build ./src/main/main.go
</syntaxhighlight>
</syntaxhighlight>
The command will create an executable named <code>main</code> and place it in the <code>${PROJECT_DIR}</code> directory.
The command will create an executable named <code>main</code> and place it by default in the <code>${PROJECT_DIR}</code> directory.


==<tt>run</tt>==
==<tt>run</tt>==

Revision as of 01:23, 15 August 2023

Internal

Overview

Commands

build

Compiles and builds an executable.

cd ${PROJECT_DIR}
go build ./src/main/main.go

The command will create an executable named main and place it by default in the ${PROJECT_DIR} directory.

run

cd $PROJECT_DIR
go run ./src/main/main.go