pare-go

v0.24.2
io.github.Dave-London/pare-go Checked 1 hour ago Published 3 days ago

Pare Go ג€” Structured Go tool output (build, test, vet, fmt, mod) as typed JSON diagnostics.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

build Go Build

Runs go build and returns structured error list (file, line, column, message).

ParameterTypeDescription
buildmodestringBuild mode (-buildmode). Controls the type of output artifact.
compactbooleanPrefer compact output
gcflagsstringArguments to pass to the Go compiler (-gcflags). Example: "-N -l" to disable optimizations.
ldflagsstringLinker flags (-ldflags). Commonly used for version injection, e.g. "-X main.version=1.0.0"
outputstringOutput binary name or path (-o)
packagesarrayPackages to build (default: ./...)
pathstringProject root path
racebooleanEnable data race detection (-race)
tagsarrayBuild tags for conditional compilation (-tags). Example: ['integration', 'linux']
trimpathbooleanRemove all file system paths from the resulting binary (-trimpath). Needed for reproducible builds.
verbosebooleanPrint the names of packages as they are compiled (-v)

test Go Test

Runs go test and returns structured test results (name, status, package, elapsed).

ParameterTypeDescription
benchstringBenchmark name filter regex (-bench)
benchmembooleanPrint memory allocation stats for benchmarks (-benchmem)
benchtimestringBenchmark run duration or count (-benchtime), e.g. '3s' or '100x'
compactbooleanPrefer compact output
countintegerRun each test and benchmark N times (-count <n>). Useful for verifying flaky test fixes.
coverbooleanEnable test coverage analysis (-cover)
coverprofilestringWrite a coverage profile to the named file (-coverprofile <file>). Implies -cover.
failfastbooleanStop running tests after the first failure (-failfast). Saves time and tokens.
packagesarrayPackages to test (default: ./...)
parallelintegerMaximum number of tests to run in parallel (-parallel <n>). Default: GOMAXPROCS.
pathstringProject root path
racebooleanEnable data race detection during tests (-race)
runstringTest name filter regex
shortbooleanTell long-running tests to shorten their run time (-short). Enables quick smoke tests.
shufflestringRandomize test execution order (-shuffle). 'on' uses a random seed, 'off' is the default.
tagsarrayBuild tags required to run tests correctly (-tags)
timeoutstringTest execution timeout (-timeout <d>). Examples: '30s', '5m', '1h'. Default: 10m.

vet Go Vet

Runs go vet and returns structured static analysis diagnostics with analyzer names. Uses -json flag for native JSON output with automatic text fallback.

ParameterTypeDescription
analyzersarraySpecific analyzers to enable or disable. Prefix with '-' to disable. Example: ['shadow', '-printf']
compactbooleanPrefer compact output
contextLinesintegerNumber of context lines to include around each diagnostic (-c=N)
packagesarrayPackages to vet (default: ./...)
pathstringProject root path
tagsarrayBuild tags for correct vetting of conditionally compiled code (-tags)
vettoolstringPath to a custom analyzer tool binary (-vettool)

run Go Run

Runs a Go program and returns structured output (stdout, stderr, exit code).

ParameterTypeDescription
argsarrayArguments to pass to the program
buildArgsarrayBuild flags to pass to go run (e.g., '-tags=integration'). Note: flags like -race and -tags have dedicated params for discoverability, but can also be passed here. Flag injection checks are not applie…
compactbooleanPrefer compact output
execstringCustom execution wrapper (-exec). The built binary is passed to this command instead of being run directly.
filestringGo file or package to run (default: .)
maxOutputintegerMaximum length in characters for stdout/stderr output. Output exceeding this limit will be truncated. Default: no limit. Max: 1048576 (1MB).
pathstringProject root path
racebooleanEnable data race detection (-race)
streambooleanReturn tail-focused output for long-running programs. This is a streaming-like mode that keeps recent lines.
tagsarrayBuild tags for conditional compilation (-tags)
tailLinesintegerWhen stream is true, keep this many trailing stdout/stderr lines
timeoutintegerProgram execution timeout in milliseconds. Overrides the default 300s build timeout. Min: 1000 (1s), Max: 600000 (10m).

mod-tidy Go Mod Tidy

Runs go mod tidy to add missing and remove unused module dependencies.

ParameterTypeDescription
compactbooleanPrefer compact output
compatstringPreserve backward compatibility with the specified Go version (-compat=<version>). Example: '1.20'
continueOnErrorbooleanAttempt to proceed despite errors encountered while loading packages (-e)
diffbooleanNon-destructive check mode: show what changes would be made without modifying files (-diff)
goVersionstringSet the expected Go language version (-go=<version>). Example: '1.21'
pathstringProject root path
verbosebooleanPrint information about removed modules (-v)

fmt Go Fmt

Checks or fixes Go source formatting using gofmt. In check mode (-l), lists unformatted files. In fix mode (-w), rewrites files.

ParameterTypeDescription
allErrorsbooleanReport all errors, not just the first 10 per file (-e)
checkbooleanCheck mode: list unformatted files without fixing (default: false)
compactbooleanPrefer compact output
diffbooleanDisplay diffs instead of rewriting files (-d)
pathstringProject root path
patternsarrayFile patterns to format (default: ['.'])
simplifybooleanTry to simplify code in addition to formatting (-s)

generate Go Generate

Runs go generate directives in Go source files. WARNING: may execute untrusted code.

ParameterTypeDescription
commandsbooleanPrint commands as they are executed (-x)
compactbooleanPrefer compact output
dryRunbooleanPrint the commands that would be executed but do not run them (-n). Essential for safe previewing.
pathstringProject root path
patternsarrayPackages to generate (default: ./...)
runstringRun only generators whose directive matches this regexp (-run <regexp>). Reduces execution scope and risk.
skipstringSkip generators whose directive matches this regexp (-skip <regexp>). Useful to exclude known-slow or broken generators.
tagsarrayBuild tags for conditional compilation (-tags)
timeoutintegerExecution timeout in milliseconds for go generate
verbosebooleanPrint the names of packages and files as they are processed (-v)

env Go Env

Returns Go environment variables as structured JSON. Optionally request specific variables.

ParameterTypeDescription
changedbooleanShow only variables whose effective value differs from the default (-changed)
compactbooleanPrefer compact output
pathstringProject root path
varsarraySpecific environment variables to query (e.g., ['GOROOT', 'GOPATH'])

list Go List

Lists Go packages or modules and returns structured information. When `modules` is true, lists modules (with path, version, dir); otherwise lists packages (with dir, importPath, name, goFiles, testGoFiles).

ParameterTypeDescription
compactbooleanPrefer compact output
depsbooleanList not just the named packages but also all their transitive dependencies (-deps)
findbooleanFind packages matching the patterns without resolving dependencies (-find). Faster for simple listing.
jsonFieldsarraySelective JSON fields for go1.22+ (-json=Field1,Field2). Reduces output volume for large workspaces.
modulesbooleanList modules instead of packages (-m). When true, output uses the modules field with path, version, dir, goMod, goVersion, main, indirect.
packagesarrayPackage patterns to list (default: ['./...'])
pathstringProject root path
tagsarrayBuild tags that may affect which packages are listed (-tags)
tolerateErrorsbooleanTolerate errors in packages -- useful for listing packages in partially broken projects (-e)
updatesbooleanShow available module updates (-u). Requires module mode (-m) which will be auto-enabled.
versionsbooleanShow all known versions of each module (-versions). Requires module mode (-m) which will be auto-enabled.

get Go Get

Downloads and installs Go packages and their dependencies.

ParameterTypeDescription
packages *arrayPackages to install (e.g., ['github.com/pkg/errors@latest'])
compactbooleanPrefer compact output
downloadOnlybooleanDownload the named packages but do not install them (-d)
pathstringProject root path
testDepsbooleanAlso download packages needed to build and test the specified packages (-t)
updatestringUpdate modules: 'all' maps to -u (update to latest), 'patch' maps to -u=patch (patch-level updates only)
verbosebooleanPrint information about download and resolution progress (-v)

golangci-lint golangci-lint

Runs golangci-lint and returns structured lint diagnostics (file, line, linter, severity, message).

ParameterTypeDescription
buildTagsarrayBuild tags for correct analysis (--build-tags <tag1,tag2,...>)
compactbooleanPrefer compact output
concurrencyintegerNumber of CPUs to use for linting (--concurrency <n>). Default: number of CPUs.
configstringPath to golangci-lint config file
disablearrayDisable specific linters (--disable <linter1,linter2,...>)
enablearrayEnable specific linters (--enable <linter1,linter2,...>)
fastbooleanRun only fast linters for quick feedback during iteration (--fast)
fixbooleanAutomatically fix found issues where possible (--fix)
maxIssuesPerLinterintegerMaximum issues per linter (--max-issues-per-linter <n>). 0 means unlimited. Default: 50.
maxSameIssuesintegerMaximum number of same issues reported (--max-same-issues <n>). 0 means unlimited. Default: 3.
newbooleanShow only new issues (--new). Useful for incremental linting.
newFromRevstringShow only new issues created after the specified git revision (--new-from-rev <rev>). Essential for PR review workflows.
pathstringProject root path
patternsarrayFile patterns or packages to lint (default: ['./...'])
presetsarrayEnable linter presets (--presets <preset1,preset2,...>)
sortResultsbooleanSort lint results for consistent output (--sort-results)
timeoutstringTimeout for the linter run (--timeout <duration>). Example: '5m', '300s'. Default: 1m.