Go: HTTP/2 Gets a Major Makeover
The Go team delivered 22 commits focused on a massive HTTP/2 refactoring effort led by Damien Neil. The biggest change removes the old h2_bundle.go file and reorganizes HTTP/2 code into a cleaner internal structure, while also improving test performance by isolating slow-running tests.
Duration: PT3M53S
https://podlog.io/listen/go-e282e2e6/episode/go-http-2-gets-a-major-makeover-5e0081a2
Transcript
Hey there, Go developers! Welcome back to another episode of the Go podcast. I'm so excited to catch up with you today because we've got some really fascinating changes to dig into from March 13th, 2026.
You know that feeling when you finally decide to clean out that one closet that's been bothering you for months? Well, the Go team just had one of those moments with HTTP/2, and let me tell you, it's been quite the spring cleaning session!
So today we're looking at 22 commits, and while there weren't any merged pull requests, these commits tell an absolutely compelling story about code organization and performance improvements. The star of today's show is definitely Damien Neil, who's been on an absolute mission to restructure how HTTP/2 works under the hood.
Let me paint you a picture of what's been happening. For the longest time, Go has had this file called h2_bundle.go - and if you've never seen it, imagine over 12,000 lines of bundled HTTP/2 code all smooshed together. Not exactly what you'd call maintainable, right? Well, Damien just said "enough is enough" and completely reworked the entire HTTP/2 architecture.
The big change here is moving from that massive h2_bundle.go file to a clean, organized net/http/internal/http2 package structure. This isn't just moving files around for fun - this is about making the codebase more maintainable, easier to test, and frankly, just more pleasant to work with. When you're dealing with something as complex as HTTP/2, having clean boundaries and clear organization makes all the difference.
What I love about this refactoring is how thoughtful it is. Damien didn't just move code - he reworked the internal types to avoid import cycles, updated tests to use the proper net/http Transport and Server interfaces instead of the internal HTTP/2 versions, and even cleaned up some testing infrastructure that was causing headaches with synctest.
Speaking of tests, Michael Matloob made a really practical improvement that I think we can all appreciate. You know those tests that take forever to run? The ones that make you think twice about running the full test suite during development? Michael created a new verylongtest package specifically for those exceptionally slow tests. It's such a simple idea, but it's going to make day-to-day development so much smoother when you can run the regular test suite without waiting around for the slowest tests to finish.
There's also a nice little documentation improvement from Alan Donovan that clarifies how ContainsFunc works across bytes, slices, and strings packages. It now explicitly documents that the function short-circuits - meaning it stops as soon as it finds a match. These kinds of clarifications might seem small, but they prevent so much confusion down the road.
What really impresses me about this whole HTTP/2 refactoring is the attention to detail. Damien even took the time to remove some benchmarks that didn't play well with synctest, and moved DetectContentType into a shared internal location so both HTTP/1 and HTTP/2 can use it cleanly. These are the kinds of changes that might not be glamorous, but they make the codebase so much better to work with.
For today's focus, if you're working on any large codebases, take a page from this refactoring playbook. Sometimes the best thing you can do for your code is to step back and ask: "How can we organize this better?" Don't be afraid to make those big structural changes when they improve maintainability. And definitely consider separating your slow tests from your fast ones - your future self will thank you during those quick development cycles.
That's a wrap for today's episode! The Go team continues to show us that great software isn't just about adding features - it's about constantly improving the foundation. Keep coding, keep learning, and I'll catch up with you next time with more Go goodness. Until then, happy coding!