Go Tool: Difference between revisions
Jump to navigation
Jump to search
(→fmt) |
(→get) |
||
Line 16: | Line 16: | ||
==<tt>get</tt>== | ==<tt>get</tt>== | ||
The <code>get</code> command downloads packages and installs them. | The <code>get</code> command downloads packages and installs them. | ||
==<tt>list</tt>== | |||
The <code>list</code> command lists all installed packages. | |||
==<tt>run</tt>== | ==<tt>run</tt>== |
Revision as of 01:29, 15 August 2023
Internal
Commands
build
The build
command compiles and builds an executable.
cd ${PROJECT_DIR}
go build ./src/main/main.go
The command will create an executable named after the first source file, in this case main
, and will place it by default in the ${PROJECT_DIR}
directory.
doc
The doc
command prints documentation for a package.
fmt
The fmt
("format") command formats source code files.
get
The get
command downloads packages and installs them.
list
The list
command lists all installed packages.
run
cd $PROJECT_DIR
go run ./src/main/main.go