frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

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

https://gohawk.dev/
1•its-malbolge-ti•11m ago

Comments

its-malbolge-ti•9m ago
Hey HN! For the past few months, I've been working really hard on a static analysis tool called gohawk, and have successfully used it to find bugs in Caddy / Docker / k8s (links in the README). It's meant to catch resource leaks and concurrency errors in Go code, such as the following example:

    func fetch(url string) ([]byte, error) {
     resp, err := http.Get(url)
     if err != nil {
      return nil, err
     }
     if resp.StatusCode != http.StatusOK {
      return nil, fmt.Errorf("unexpected status: %s", resp.Status) // resp isn't closed on all paths
     }
     defer resp.Body.Close()
     return io.ReadAll(resp.Body)
    }
I built this tool after realizing that Staticcheck and other linters don't really cover this ground yet. It works by building a symbolic heap model of the program under analysis, so that it can track object references with a high degree of accuracy. (I took this idea from Meta's Infer tool, which is developed exclusively for C++/Objective-C/Java, and generalized it to fit Go.) For example, it's able to tell in this case that r1 and r2 are the same.

    type fileBox struct {
     slots [2]*os.File
    }

    func example(path string, replacement *os.File) error {
     r1, err := os.Open(path)
     if err != nil {
      return err
     }

     original := fileBox{slots: [2]*os.File{replacement, r1}}
     copied := original

     alias := &original
     alias.slots[1] = replacement

     window := copied.slots[1:]
     r2 := window[0]
     return r2.Close()
    }
It's also capable of detecting certain types of goroutine leaks / lock inversions. For example, the following code gets flagged:

    func runWithTimeout(work func() error) error {
     done := make(chan error)
     go func() { done <- work() }()

     select {
     case err := <-done:
      return err
     case <-time.After(time.Second):
      return errors.New("operation timed out")
     }
    }
HOW THIS WAS BUILT / TRAINED

I'll be up front with y'all and say I used AI a lot to help me in the process of writing gohawk. However, I will stand by the fact that it's not just AI slop -- I'm a clean code fanatic, and the pipeline has been deliberately engineered.

I really wanted the user experience to be buttery smooth when downloading and using this, so I had an AI agent continuously download hundreds of repos from the Internet, run gohawk on them, and report back if there were any false positives. (Yes, I know, slightly overkill :^) ) It's at a point where I think false positives on new code should be fairly rare.

OTHER FEATURES

- Really rich diagnostics (I took inspo from rustc -- the full lineage of the error gets reported, including error spans) - Documentation website (https://gohawk.dev) -- Contains detailed overview of all the supported analyzers. The diagnostic messages link out to the website - Custom analysis runner -- I found `go vet` to be really slow because it would spend a lot of time serializing and deserializing facts across packages, so I rolled my own runner to replace it. - Performant -- From a cold cache, it's able to analyze Docker in around 13s, and the whole of Kubernetes around 76s.

Building this out was a really awesome learning experience for me, and I'm planning to make a blog post about it soon -- stay tuned. Also hoping to get it integrated directly into GolangCI but gotta ask the maintainer first, so fingers crossed.

I genuinely hope you guys can download and enjoy the effort I put into this project. Feedback and contributions are welcome, and I'm planning to set up a Discord or IRC channel in the near future.

Shooting Bias

https://en.wikipedia.org/wiki/Shooting_bias
1•chistev•7m ago•0 comments

Show HN: JNum – Pure Java 25 NumPy/BLAS via Project Panama FFM and Vector API

https://github.com/CH-Abhinav/JNum
1•CH-Abhinav•10m ago•0 comments

WSP MCP – Free MCP Plugin for WordPress

https://github.com/bilalnaseer/wsp-wordpress-mcp
1•wspmcp67•10m ago•0 comments

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

https://gohawk.dev/
1•its-malbolge-ti•11m ago•1 comments

AI is getting smarter. Are we thinking better?

https://www.daybranch.com/
1•brunohenriquede•12m ago•0 comments

Show HN: Minimal and self-hosted website monitoring

https://github.com/tanin47/jping
1•tanin•14m ago•0 comments

Where to Buy a Custom Fake ID with Your Own Details

https://www.yoloids.com/where-to-buy-a-custom-fake-id-with-your-own-details/
1•malinograham•14m ago•0 comments

Ask HN: Is GitHub Downloads Down?

1•t0duf0du•14m ago•0 comments

Algorithm in the Consulting Room

https://medium.com/@smoking2man/algorithm-in-the-consulting-room-on-the-architectural-mismatch-be...
1•Aldus551•14m ago•0 comments

What benefit does a San Francisco HQ offer if you are not a frontier AI lab?

1•jpqwerty•17m ago•1 comments

Redis Got Ported to Rust

https://github.com/kividbio/kividb/blob/master/README.md
1•robindooh•18m ago•0 comments

Show HN: Qwen Reasoning Traces Trainer and Inference Server

https://github.com/cookiengineer/qwen-reasoning-trainer
1•cookiengineer•19m ago•0 comments

Show HN: Open-Source Audit of 1.58M Harvard Orbits and Vera Rubin Predictions

https://github.com/Dr-Logvinovich/IT3-Solar-System-Quantum-Architecture/
3•wichein•20m ago•0 comments

Interactive Map of GTA Series

https://gtamap.io/gta-5-interactive-map/
1•wasmgame845•21m ago•0 comments

Job Finding and Unemployment in the Age of AI

https://www.clevelandfed.org/publications/economic-commentary/2026/ec-202626-job-finding-and-unem...
1•rohanm93•23m ago•0 comments

Ask HN: Researchers / PhDs interested in quantitative AutoResearch?

1•platopic•24m ago•0 comments

LG Research releases K-Exaone 2.5 API for free

https://www.lgresearch.ai/news/view?seq=755
2•yje07039•27m ago•1 comments

Erlang (Unit)

https://en.wikipedia.org/wiki/Erlang_(unit)
1•gjvc•29m ago•0 comments

After Democrats' midterm wins, Palantir CEO Alex Karp says he's a 'progressive'

https://www.washingtonpost.com/technology/2026/11/11/after-democrats-midterm-wins-palantir-ceo-al...
4•MadrasTh0rn•29m ago•1 comments

Multiple remote code execution vulnerabilities in danfoss sm-800A

https://www.midnightblue.nl/blog/multiple-rce-danfoss-aksm800a
1•tosti•30m ago•0 comments

How software engineering is changing: a tale of two eras

https://newsletter.pragmaticengineer.com/p/how-software-engineering-is-changing
1•r4um•34m ago•0 comments

Towards Verifiable LLM Infra

https://haoailab.com/blogs/verifiable-llm-infra/
2•matt_d•45m ago•0 comments

They're in Ukraine. Why Do Their Phones Say They're in Peru?

https://www.nytimes.com/2026/11/11/world/europe/ukraine-lima-electronic-warefare-gps.html
3•bschne•48m ago•1 comments

I'm Working on a FOSS Linux Pinbal Simulation Engine

https://www.getlazarus.org/forums/topic/17/
6•sysrpl•48m ago•1 comments

Open DLSS alternative claims better performance and quality with AMD support

https://github.com/apex-compute/ANR
2•mehmetoguzderin•50m ago•0 comments

Perplexity Search API Review

https://www.stork.ai/en/perplexity-search-api
1•GloVin•50m ago•0 comments

Beej's Guide to Networking Concepts

https://beej.us/guide/bgnet0/
1•vinhnx•55m ago•0 comments

How to Route and Configure a /48 IPv6 Subnet in AlmaLinux 8 and 9

https://www.migservers.com/tutorials/howto/route-ipv6-48-subnet-almalinux/
1•migservers•55m ago•0 comments

Timsort

https://github.com/python/cpython/blob/2fc68e180ffdb31886938203e89a75b220a58cec/Objects/listsort.txt
2•vismit2000•57m ago•1 comments

"How Has Serving Impacted You?" Veterans of the US Military in Their Own Words

https://crimethinc.com/2026/11/11/how-has-serving-impacted-you-veterans-of-the-us-military-in-the...
3•Refreeze5224•1h ago•1 comments