All apps/Go

Go

go

An open source programming language that makes it easy to build simple, reliable, and efficient software.

Runs as go|macOS, Linux, Windows|go.dev

Command form

ai-draft · 8 tasks · 39 fields

Build, test, run, format and manage modules. Flags come from the Fig completion data, which omits some options (for example -run and -count for go test).

Opens the form; the finished command lands at your prompt, unrun
otty gui go

go build

Build packages

Compile packages and dependencies.

Build packagesExample values, fixed in this page — nothing here reaches a terminal
Basic
Packages
any
Output
any
Verbose
-v
TasksEach one presets the form for one job
Build
packagesoutputv
Trimmed build
packagesoutputtrimpathldflags
ParametersOnly these flags are editable in the form
Packages
Defaults to the package in the current directory.
path · positional 0 · repeatable
Output
File or directory for the result.
path
-o
Verbose
Print package names as they are compiled.
boolean
-v
Race detector
boolean
-race
Trim paths
boolean
-trimpath
Build tags
Comma-separated list of build tags.
string
-tags
Linker flags
Arguments passed to go tool link.
string · repeatable
-ldflags
Module mode
string
-modreadonlyvendormod
Force rebuild
boolean
-a
Print only
Print the commands but do not run them.
boolean
-n
Print commands
boolean
-x

go test

Test packages

Run tests in the current package (the package list is not offered; add it after the flags).

Test packagesExample values, fixed in this page — nothing here reaches a terminal
Basic
Verbose
-v
Race detector
-race
Build tags
string
TasksEach one presets the form for one job
Verbose tests
vracetags
JSON results
jsonrace
ParametersOnly these flags are editable in the form
Verbose
Print package names as they are compiled.
boolean
-v
Race detector
boolean
-race
Trim paths
boolean
-trimpath
Build tags
Comma-separated list of build tags.
string
-tags
Module mode
string
-modreadonlyvendormod
Force rebuild
boolean
-a
Print only
Print the commands but do not run them.
boolean
-n
Print commands
boolean
-x
JSON output
boolean
-json
Compile only
Compile the test binary without running it.
boolean
-c
Test binary
path
-o

go run

Run a package

Compile and run a Go program.

Run a packageExample values, fixed in this page — nothing here reaches a terminal
Basic
Package or file*
any
Race detector
-race
TasksEach one presets the form for one job
Run
packagerace
ParametersOnly these flags are editable in the form
Package or file
For example . or main.go.
path · positional 0
Verbose
Print package names as they are compiled.
boolean
-v
Race detector
boolean
-race
Trim paths
boolean
-trimpath
Build tags
Comma-separated list of build tags.
string
-tags
Module mode
string
-modreadonlyvendormod
Print commands
boolean
-x

go get

Add a dependency

Add a dependency to the current module and install it.

Add a dependencyExample values, fixed in this page — nothing here reaches a terminal
Basic
Module*
string
Update
-u
TasksEach one presets the form for one job
Add module
urlu
ParametersOnly these flags are editable in the form
Module
Module path with an optional @version.
string · positional 0
Update
Update to newer minor or patch releases.
boolean
-u
Include tests
boolean
-t
Download only
boolean
-d
Verbose
boolean
-v

go mod tidy

Tidy go.mod

Make go.mod match the source code in the module.

Tidy go.modExample values, fixed in this page — nothing here reaches a terminal
Basic
Verbose
-v
TasksEach one presets the form for one job
Tidy
v
ParametersOnly these flags are editable in the form
Proceed despite errors
boolean
-e
Verbose
Print information about removed modules.
boolean
-v

go fmt

Format sources

Reformat package sources with gofmt.

Format sourcesExample values, fixed in this page — nothing here reaches a terminal
Basic
Packages
any
TasksEach one presets the form for one job
Format
packages
ParametersOnly these flags are editable in the form
Packages
Defaults to the current package.
path · positional 0 · repeatable
Print only
Print the commands that would run.
boolean
-n
Print commands
boolean
-x
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed go against its version. A form that does not match your version is not offered.