rtk-ai/rtk

Expand Go ecosystem coverage: go mod, go list, gotestsum, govulncheck, staticcheck, buf, goreleaser

Open

#1,990 创建于 2026年5月20日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Rust (2,914 fork)batch import
area:clienhancementhelp wantedpriority:medium

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 11天 1小时) (30 天内合并 45 个 PR)

描述

Summary

RTK currently compresses go test, go build, go vet, and golangci-lint. Other Go-ecosystem commands run as passthrough with no token savings. This issue proposes adding compression for high-ROI tools.

Current Coverage

Command Strategy
go test Inject -json, NDJSON aggregation
go build Errors-only
go vet Drop location noise
golangci-lint Force JSON, cluster by rule

Everything else: passthrough.

Proposed Additions (by ROI)

Tier 1 — high verbosity, high frequency

  1. go mod tidy — drop go: finding/downloading, keep added/removed/upgraded deltas. ~80% savings.
  2. go list -m all / go list ./... — inject -json, reuse NDJSON parser. ~80% savings.
  3. go mod graph — dedupe edges, depth-limit, optional --deep. ~70% savings.
  4. gotestsum — alias to existing go test NDJSON path (gotestsum forwards -json). Trivial.
  5. govulncheck — JSON mode, one line per finding OSV-id pkg@ver call-path. ~85% savings on findings.
  6. staticcheck — JSON mode, reuse golangci clustering. ~60-80% savings.

Tier 2

  1. buf lint / buf build--error-format=json, cluster like golangci-lint.
  2. goreleaser release — line-filter progress bullets, keep section headers + artifacts + failures. ~80% savings.
  3. gofmt -l / goimports -l — count + first 10 paths. TOML filter sufficient.
  4. go generate ./... — bracket each //go:generate, keep only failed children.
  5. air — strip startup banner, keep build errors.
  6. delve non-interactive — strip startup banner only.

Tier 3

migrate, sqlc generate, ent generate, swag init, wire, mockgen, revive, errcheck, ineffassign, benchstat.

Implementation Patterns

  • Rust module + GoCommands enum branch: go mod, go list (subcommand of go).
  • Top-level enum + src/cmds/go/<tool>_cmd.rs: gotestsum, govulncheck, staticcheck, buf, goreleaser (separate binaries).
  • TOML filter under src/filters/: gofmt, goimports, air, migrate, swag (line-oriented, no JSON).

Data Point — current go test compression

Tested on minimal demo (2 pass / 2 fail / 1 skip, 1 package):

Variant Bytes Lines
go test -json (RTK input) 3194 27
rtk go test (compressed) 384 9
Reduction 88% 67%

Real-world projects with multiple packages have higher ratios.

Recommended Order

  1. go mod tidy (line filter, easy)
  2. go list (reuse NDJSON parser)
  3. gotestsum (alias, trivial)
  4. govulncheck (new module, JSON)
  5. staticcheck (new module, JSON, reuse clustering)
  6. buf lint / buf build
  7. goreleaser
  8. TOML filters: gofmt -l, goimports -l

Open Questions

  • gotestsum auto-detect via PATH or require explicit rtk gotestsum ...?
  • go mod graph deep mode — full DAG to tempfile + path, or always inline?
  • Should TOML filters move to src/filters/go/ subdir once 3+ exist?

贡献者指南