alpardfm/go-cost-analyzer — reverse-engineered prompt
Reverse engineered prompt
Build me a Go command line tool called go cost analyzer that scans a Go project and tells developers where their code may waste memory, IO, concurrency, or error handling costs.
It should accept a project path, walk the Go files, skip vendor, git, testdata, generated files, and tests by default, then run checks for about 20 cost related patterns like missing context cancellation, goroutine leaks, inefficient JSON, string building, slice allocation, connection pooling, logging, Redis pipeline, worker pools, and struct alignment.
I want a clear text report by default, plus JSON output for automation. Include a score from 0 to 100, severity weighting, finding counts, suppressed counts, and simple recommendations. Add flags for output file, format, verbose mode, pattern filters, threshold, extra excludes, include tests, and scale estimates at 1M, 10M, or 100M requests.
Also support a .cost analyzer config file, inline noinspect comments, useful exit codes, and good tests. Look up current Go docs online if needed.
Want more depth? Deep Reverse