pare-go
v0.24.2Pare 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).
| Parameter | Type | Description |
|---|---|---|
buildmode | string | Build mode (-buildmode). Controls the type of output artifact. |
compact | boolean | Prefer compact output |
gcflags | string | Arguments to pass to the Go compiler (-gcflags). Example: "-N -l" to disable optimizations. |
ldflags | string | Linker flags (-ldflags). Commonly used for version injection, e.g. "-X main.version=1.0.0" |
output | string | Output binary name or path (-o) |
packages | array | Packages to build (default: ./...) |
path | string | Project root path |
race | boolean | Enable data race detection (-race) |
tags | array | Build tags for conditional compilation (-tags). Example: ['integration', 'linux'] |
trimpath | boolean | Remove all file system paths from the resulting binary (-trimpath). Needed for reproducible builds. |
verbose | boolean | Print the names of packages as they are compiled (-v) |
test Go Test
Runs go test and returns structured test results (name, status, package, elapsed).
| Parameter | Type | Description |
|---|---|---|
bench | string | Benchmark name filter regex (-bench) |
benchmem | boolean | Print memory allocation stats for benchmarks (-benchmem) |
benchtime | string | Benchmark run duration or count (-benchtime), e.g. '3s' or '100x' |
compact | boolean | Prefer compact output |
count | integer | Run each test and benchmark N times (-count <n>). Useful for verifying flaky test fixes. |
cover | boolean | Enable test coverage analysis (-cover) |
coverprofile | string | Write a coverage profile to the named file (-coverprofile <file>). Implies -cover. |
failfast | boolean | Stop running tests after the first failure (-failfast). Saves time and tokens. |
packages | array | Packages to test (default: ./...) |
parallel | integer | Maximum number of tests to run in parallel (-parallel <n>). Default: GOMAXPROCS. |
path | string | Project root path |
race | boolean | Enable data race detection during tests (-race) |
run | string | Test name filter regex |
short | boolean | Tell long-running tests to shorten their run time (-short). Enables quick smoke tests. |
shuffle | string | Randomize test execution order (-shuffle). 'on' uses a random seed, 'off' is the default. |
tags | array | Build tags required to run tests correctly (-tags) |
timeout | string | Test 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.
| Parameter | Type | Description |
|---|---|---|
analyzers | array | Specific analyzers to enable or disable. Prefix with '-' to disable. Example: ['shadow', '-printf'] |
compact | boolean | Prefer compact output |
contextLines | integer | Number of context lines to include around each diagnostic (-c=N) |
packages | array | Packages to vet (default: ./...) |
path | string | Project root path |
tags | array | Build tags for correct vetting of conditionally compiled code (-tags) |
vettool | string | Path to a custom analyzer tool binary (-vettool) |
run Go Run
Runs a Go program and returns structured output (stdout, stderr, exit code).
| Parameter | Type | Description |
|---|---|---|
args | array | Arguments to pass to the program |
buildArgs | array | Build 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… |
compact | boolean | Prefer compact output |
exec | string | Custom execution wrapper (-exec). The built binary is passed to this command instead of being run directly. |
file | string | Go file or package to run (default: .) |
maxOutput | integer | Maximum length in characters for stdout/stderr output. Output exceeding this limit will be truncated. Default: no limit. Max: 1048576 (1MB). |
path | string | Project root path |
race | boolean | Enable data race detection (-race) |
stream | boolean | Return tail-focused output for long-running programs. This is a streaming-like mode that keeps recent lines. |
tags | array | Build tags for conditional compilation (-tags) |
tailLines | integer | When stream is true, keep this many trailing stdout/stderr lines |
timeout | integer | Program 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.
| Parameter | Type | Description |
|---|---|---|
compact | boolean | Prefer compact output |
compat | string | Preserve backward compatibility with the specified Go version (-compat=<version>). Example: '1.20' |
continueOnError | boolean | Attempt to proceed despite errors encountered while loading packages (-e) |
diff | boolean | Non-destructive check mode: show what changes would be made without modifying files (-diff) |
goVersion | string | Set the expected Go language version (-go=<version>). Example: '1.21' |
path | string | Project root path |
verbose | boolean | Print 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.
| Parameter | Type | Description |
|---|---|---|
allErrors | boolean | Report all errors, not just the first 10 per file (-e) |
check | boolean | Check mode: list unformatted files without fixing (default: false) |
compact | boolean | Prefer compact output |
diff | boolean | Display diffs instead of rewriting files (-d) |
path | string | Project root path |
patterns | array | File patterns to format (default: ['.']) |
simplify | boolean | Try to simplify code in addition to formatting (-s) |
generate Go Generate
Runs go generate directives in Go source files. WARNING: may execute untrusted code.
| Parameter | Type | Description |
|---|---|---|
commands | boolean | Print commands as they are executed (-x) |
compact | boolean | Prefer compact output |
dryRun | boolean | Print the commands that would be executed but do not run them (-n). Essential for safe previewing. |
path | string | Project root path |
patterns | array | Packages to generate (default: ./...) |
run | string | Run only generators whose directive matches this regexp (-run <regexp>). Reduces execution scope and risk. |
skip | string | Skip generators whose directive matches this regexp (-skip <regexp>). Useful to exclude known-slow or broken generators. |
tags | array | Build tags for conditional compilation (-tags) |
timeout | integer | Execution timeout in milliseconds for go generate |
verbose | boolean | Print 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.
| Parameter | Type | Description |
|---|---|---|
changed | boolean | Show only variables whose effective value differs from the default (-changed) |
compact | boolean | Prefer compact output |
path | string | Project root path |
vars | array | Specific 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).
| Parameter | Type | Description |
|---|---|---|
compact | boolean | Prefer compact output |
deps | boolean | List not just the named packages but also all their transitive dependencies (-deps) |
find | boolean | Find packages matching the patterns without resolving dependencies (-find). Faster for simple listing. |
jsonFields | array | Selective JSON fields for go1.22+ (-json=Field1,Field2). Reduces output volume for large workspaces. |
modules | boolean | List modules instead of packages (-m). When true, output uses the modules field with path, version, dir, goMod, goVersion, main, indirect. |
packages | array | Package patterns to list (default: ['./...']) |
path | string | Project root path |
tags | array | Build tags that may affect which packages are listed (-tags) |
tolerateErrors | boolean | Tolerate errors in packages -- useful for listing packages in partially broken projects (-e) |
updates | boolean | Show available module updates (-u). Requires module mode (-m) which will be auto-enabled. |
versions | boolean | Show 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.
| Parameter | Type | Description |
|---|---|---|
packages * | array | Packages to install (e.g., ['github.com/pkg/errors@latest']) |
compact | boolean | Prefer compact output |
downloadOnly | boolean | Download the named packages but do not install them (-d) |
path | string | Project root path |
testDeps | boolean | Also download packages needed to build and test the specified packages (-t) |
update | string | Update modules: 'all' maps to -u (update to latest), 'patch' maps to -u=patch (patch-level updates only) |
verbose | boolean | Print information about download and resolution progress (-v) |
golangci-lint golangci-lint
Runs golangci-lint and returns structured lint diagnostics (file, line, linter, severity, message).
| Parameter | Type | Description |
|---|---|---|
buildTags | array | Build tags for correct analysis (--build-tags <tag1,tag2,...>) |
compact | boolean | Prefer compact output |
concurrency | integer | Number of CPUs to use for linting (--concurrency <n>). Default: number of CPUs. |
config | string | Path to golangci-lint config file |
disable | array | Disable specific linters (--disable <linter1,linter2,...>) |
enable | array | Enable specific linters (--enable <linter1,linter2,...>) |
fast | boolean | Run only fast linters for quick feedback during iteration (--fast) |
fix | boolean | Automatically fix found issues where possible (--fix) |
maxIssuesPerLinter | integer | Maximum issues per linter (--max-issues-per-linter <n>). 0 means unlimited. Default: 50. |
maxSameIssues | integer | Maximum number of same issues reported (--max-same-issues <n>). 0 means unlimited. Default: 3. |
new | boolean | Show only new issues (--new). Useful for incremental linting. |
newFromRev | string | Show only new issues created after the specified git revision (--new-from-rev <rev>). Essential for PR review workflows. |
path | string | Project root path |
patterns | array | File patterns or packages to lint (default: ['./...']) |
presets | array | Enable linter presets (--presets <preset1,preset2,...>) |
sortResults | boolean | Sort lint results for consistent output (--sort-results) |
timeout | string | Timeout for the linter run (--timeout <duration>). Example: '5m', '300s'. Default: 1m. |