Repository navigation
fix: stop matching GOAWAY by a deprecated type - #415
Merged
Merged
Conversation
x/net deprecated http2.GoAwayError without naming a replacement, which has had the linter failing on main since the HTTP/2 retry work landed. Nothing is lost by dropping the type check. GoAwayError's message begins with the sentence already listed in http2ConnectionLostMessages, and that list is matched with strings.Contains, so the same failure is still recognised by the fallback a line below. The existing test that feeds a real x/net GoAwayError through IsTransportError passes unchanged, which is what says this is a tidy-up rather than a behaviour change. Matching by message was always going to be the long-term answer here: the standard library's copy of the package is internal, so its equivalent type cannot be named at all, and now neither can x/net's without a deprecation warning. Both spell the failure the same way.
taciturnaxolotl
force-pushed
the
fix/deprecated-goaway
branch
from
October 6, 2026 22:44
d721ea7 to
efe722e
Compare
taciturnaxolotl
enabled auto-merge (squash)
October 6, 2026 22:44
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
mainhas been failing lint since the HTTP/2 retry work landed:Three consecutive runs on
mainare red for this, so every PR opened since inherits a red check.x/net deprecated the type without naming a replacement, and the transport still returns it, so there is nothing to migrate to.
Why deleting the check is safe
GoAwayError.Error()renders as:That begins with the sentence already sitting in
http2ConnectionLostMessages, andmatchConnectionLostusesstrings.Contains. So the typed check and the fallback a few lines below were catching the same thing, and only the typed one is deprecated.The existing
TestIsTransportError/x/net_GoAwayErrorcase feeds a realhttp2.GoAwayErrorthroughIsTransportErrorand still passes untouched. That is the evidence this is a tidy-up and not a behaviour change — the test was not adjusted to fit.Matching by message was always going to be the long-term answer for GOAWAY anyway. The standard library's copy of http2 is internal, so its equivalent type can never be named here, and now x/net's cannot be either without a warning. Both spell the failure identically, so one fragment covers both — which is why the file already had the fragment.
StreamErrorandConnectionErrorare untouched and still matched by type; neither is deprecated.Testing
go test .passes.golangci-lint run --config=.golangci.yml ./...reports 0 issues locally, against the same v2 config CI uses.