The golang.org/x/net/http2 package contains two different implementations of the HTTP/2 transport and server, and its behavior depends on your Go version:
- The Original Implementation: This is the legacy implementation. It is used automatically if your Go version is less than 1.27.
- The Wrapping Implementation: This is a reimplementation of the
x/net/http2 APIs that wraps the standard library's net/http. It is used automatically if your Go version is 1.27 or higher.
Note: As of Go 1.27, the standard library package net/http/internal/http2 is the official source of truth for Go's HTTP/2 implementation. New features are developed there; x/net only receives critical bug and security fixes.