id = "go"
name = "Go"
homepage = "https://go.dev"
description = "An open source programming language that makes it easy to build simple, reliable, and efficient software."
icon = "SimpleIcons:go"
executables = ["go"]
[dotfiles]
paths = ["[appData]/go/env"]
exclude = [
"~/go/pkg/mod/",
"[cacheHome]/go-build/",
]
secret = []
side_effect = false
[[dotfiles.machine_lines]]
file = "[appData]/go/env"
match = { prefix = ["GOPATH", "GOBIN", "GOCACHE", "GOMODCACHE", "GOTMPDIR"] }
scope = "backup"
[commands]
format = 1
label = "Go toolchain"
description = "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)."
quality = "ai-draft"
base = "fig:go"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = false }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand]]
path = ["build"]
label = "Build packages"
description = "Compile packages and dependencies."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "packages"
label = "Packages"
description = "Defaults to the package in the current directory."
type = "path"
position = 0
path = { kind = "any", role = "input" }
multiple = true
sources = ["fig"]
[[commands.subcommand.field]]
id = "output"
label = "Output"
description = "File or directory for the result."
type = "path"
option = ["-o"]
path = { kind = "any", role = "output" }
effect = "overwrite"
sources = ["fig"]
[[commands.subcommand.field]]
id = "v"
label = "Verbose"
description = "Print package names as they are compiled."
type = "boolean"
option = ["-v"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "race"
label = "Race detector"
type = "boolean"
option = ["-race"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "trimpath"
label = "Trim paths"
type = "boolean"
option = ["-trimpath"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "tags"
label = "Build tags"
description = "Comma-separated list of build tags."
type = "string"
option = ["-tags"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "ldflags"
label = "Linker flags"
description = "Arguments passed to go tool link."
type = "string"
option = ["-ldflags"]
multiple = true
sources = ["fig"]
[[commands.subcommand.field]]
id = "mod"
label = "Module mode"
type = "string"
option = ["-mod"]
suggestions = [{ value = "readonly", label = "readonly" }, { value = "vendor", label = "vendor" }, { value = "mod", label = "mod" }]
sources = ["fig"]
[[commands.subcommand.field]]
id = "a"
label = "Force rebuild"
type = "boolean"
option = ["-a"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "n"
label = "Print only"
description = "Print the commands but do not run them."
type = "boolean"
option = ["-n"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "x"
label = "Print commands"
type = "boolean"
option = ["-x"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "build"
label = "Build"
fields = ["packages", "output", "v"]
required = []
[[commands.subcommand.task]]
id = "release"
label = "Trimmed build"
fields = ["packages", "output", "trimpath", "ldflags"]
required = []
set = { trimpath = [true] }
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["packages", "output", "v", "race", "trimpath"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["a", "n", "x", "mod", "ldflags", "tags"]
[[commands.subcommand]]
path = ["test"]
label = "Test packages"
description = "Run tests in the current package (the package list is not offered; add it after the flags)."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "v"
label = "Verbose"
description = "Print package names as they are compiled."
type = "boolean"
option = ["-v"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "race"
label = "Race detector"
type = "boolean"
option = ["-race"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "trimpath"
label = "Trim paths"
type = "boolean"
option = ["-trimpath"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "tags"
label = "Build tags"
description = "Comma-separated list of build tags."
type = "string"
option = ["-tags"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "mod"
label = "Module mode"
type = "string"
option = ["-mod"]
suggestions = [{ value = "readonly", label = "readonly" }, { value = "vendor", label = "vendor" }, { value = "mod", label = "mod" }]
sources = ["fig"]
[[commands.subcommand.field]]
id = "a"
label = "Force rebuild"
type = "boolean"
option = ["-a"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "n"
label = "Print only"
description = "Print the commands but do not run them."
type = "boolean"
option = ["-n"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "x"
label = "Print commands"
type = "boolean"
option = ["-x"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "json"
label = "JSON output"
type = "boolean"
option = ["-json"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "c"
label = "Compile only"
description = "Compile the test binary without running it."
type = "boolean"
option = ["-c"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "o"
label = "Test binary"
type = "path"
option = ["-o"]
path = { kind = "file", role = "output" }
effect = "overwrite"
sources = ["fig"]
[[commands.subcommand.task]]
id = "verbose"
label = "Verbose tests"
fields = ["v", "race", "tags"]
required = []
set = { v = [true] }
[[commands.subcommand.task]]
id = "json"
label = "JSON results"
fields = ["json", "race"]
required = []
set = { json = [true] }
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["v", "race", "tags", "json"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["a", "n", "x", "mod", "trimpath", "c", "o"]
[[commands.subcommand]]
path = ["run"]
label = "Run a package"
description = "Compile and run a Go program."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "package"
label = "Package or file"
description = "For example . or main.go."
type = "path"
position = 0
path = { kind = "any", role = "input" }
sources = ["fig"]
[[commands.subcommand.field]]
id = "v"
label = "Verbose"
description = "Print package names as they are compiled."
type = "boolean"
option = ["-v"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "race"
label = "Race detector"
type = "boolean"
option = ["-race"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "trimpath"
label = "Trim paths"
type = "boolean"
option = ["-trimpath"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "tags"
label = "Build tags"
description = "Comma-separated list of build tags."
type = "string"
option = ["-tags"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "mod"
label = "Module mode"
type = "string"
option = ["-mod"]
suggestions = [{ value = "readonly", label = "readonly" }, { value = "vendor", label = "vendor" }, { value = "mod", label = "mod" }]
sources = ["fig"]
[[commands.subcommand.field]]
id = "x"
label = "Print commands"
type = "boolean"
option = ["-x"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "run"
label = "Run"
fields = ["package", "race"]
required = ["package"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["package", "race", "tags"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["mod", "trimpath", "v", "x"]
[[commands.subcommand]]
path = ["get"]
label = "Add a dependency"
description = "Add a dependency to the current module and install it."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "url"
label = "Module"
description = "Module path with an optional @version."
type = "string"
position = 0
sources = ["fig"]
[[commands.subcommand.field]]
id = "u"
label = "Update"
description = "Update to newer minor or patch releases."
type = "boolean"
option = ["-u"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "t"
label = "Include tests"
type = "boolean"
option = ["-t"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "d"
label = "Download only"
type = "boolean"
option = ["-d"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "v"
label = "Verbose"
type = "boolean"
option = ["-v"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "add"
label = "Add module"
fields = ["url", "u"]
required = ["url"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["url", "u", "t", "d", "v"]
[[commands.subcommand]]
path = ["mod", "tidy"]
label = "Tidy go.mod"
description = "Make go.mod match the source code in the module."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "e"
label = "Proceed despite errors"
type = "boolean"
option = ["-e"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "v"
label = "Verbose"
description = "Print information about removed modules."
type = "boolean"
option = ["-v"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "tidy"
label = "Tidy"
fields = ["v"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["e", "v"]
[[commands.subcommand]]
path = ["fmt"]
label = "Format sources"
description = "Reformat package sources with gofmt."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/go.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "packages"
label = "Packages"
description = "Defaults to the current package."
type = "path"
position = 0
path = { kind = "any", role = "input" }
multiple = true
sources = ["fig"]
[[commands.subcommand.field]]
id = "n"
label = "Print only"
description = "Print the commands that would run."
type = "boolean"
option = ["-n"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "x"
label = "Print commands"
type = "boolean"
option = ["-x"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "fmt"
label = "Format"
fields = ["packages"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["packages", "n", "x"]