Show HN: Gohawk – A Resource Leak and Concurrency Static Analyzer for Go gohawk....

@show

Show HN: Gohawk – A Resource Leak and Concurrency Static Analyzer for Go gohawk.dev · 3 points · 1 comments · HN thread

TL;DR Gohawk is a new static analyzer for Go that targets resource management leaks (such as unclosed files and HTTP bodies), goroutine leaks, and lock inversions, meant to complement go vet, Staticcheck and go-critic. Its author says it has found bugs in Docker, Kubernetes and Caddy and runs standalone or as a go vet tool with no config file. The single commenter, the author, explains the design and the AI-assisted development process.

  • Targets resource leaks, concurrency bugs and error-handling reliability rather than general style or lint issues.
  • Builds a symbolic heap model to track object references and aliasing, an approach the author adapted from Meta's Infer for C++, Objective-C and Java.
  • Example flagged cases include an HTTP response body not closed on an early-return error path and a goroutine leaked by a select with a timeout branch.
  • Runs as a standalone tool or as a go vet tool; every check is a command-line flag and there is no configuration file.
  • Uses a custom analysis runner because go vet spent much time serializing facts across packages; reported cold-cache times are about 13s for Docker and 76s for Kubernetes.
  • Author used an AI agent to run the tool over hundreds of public repos to measure false positives, and says new-code false positives should be rare.

Discussion The thread is essentially a single long top-level comment from the author, with no replies. It introduces the tool, gives code examples of the bugs it catches, and describes the build process. The mood is friendly and open, with the author inviting feedback and admitting upfront to heavy AI assistance in building the tool.

  • Interested in the design, mainly the heap-model approach borrowed from Infer (a few): The only substantive engagement is the author's own explanation of the symbolic heap model and how it tracks aliasing across struct copies and slices. No independent commenter has yet tested or critiqued the claims.
  • AI-assisted development disclosed, with quality claims made by the author (a few): The author says AI was used heavily, but argues the pipeline was carefully engineered and that automated repo testing keeps false positives low. These claims have not been independently verified in the thread.

#golang #staticAnalysis #linters #concurrency #resourceLeaks #showHN