Go Tool: Difference between revisions
(→build) |
(→run) |
||
Line 27: | Line 27: | ||
The <code>list</code> command lists all installed packages. | The <code>list</code> command lists all installed packages. | ||
==<tt>test</tt>== | ==<tt>test</tt>== | ||
The <code>test</code> command runs tests. For more details, see: | The <code>test</code> command runs tests. For more details, see: |
Revision as of 02:00, 8 September 2023
Internal
Overview
go
is a command line tool with multiple uses: package manager, build tool and test driver. go
manage packages in workspaces, query metadata about packages, print documentation, build, format, download, test, etc.
Commands
Help
go help <command>
go help build
build
The build
command compiles one or more packages and builds the executable if the package main
is among the compiled packages. The tool is sensitive to GOPATH mode. For more details, see:
install
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.
test
The test
command runs tests. For more details, see:
env
The env
command prints the effective values of the environment variables relevant to the tool chain.
go env GOOS GOARCH GOPATH
get
The get
command retrieve and update packages.
TODO Addison-Wesley The Go Programming Language Section 10.7.2