Repository navigation
Fix deprecated API lint findings - #312
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused API migrations preserve intended behavior and are adequately covered by the new transport test.
0 open findings
What changed in this PR
Updates deprecated Go APIs while preserving Unix-domain socket transport behavior.
Changes:
- Replaces deprecated reflection constants.
- Migrates HTTP transport dialers to context-aware APIs.
- Adds HTTP/HTTPS Unix socket coverage.
| File | Description |
|---|---|
pkg/x/markdown/accessibility_test.go |
Uses reflect.Pointer. |
pkg/api/http_client.go |
Uses context-aware socket dialers. |
pkg/api/http_client_test.go |
Tests Unix socket routing. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
williammartin
marked this pull request as ready for review
October 8, 2026 17:37
williammartin
requested review from
a team,
BagToad and
tidy-dev
and removed request for
a team and
tidy-dev
October 8, 2026 17:37
BagToad
approved these changes
Oct 8, 2026
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.
Description
Fixes the 4
golangci-lintfindings ontrunk, which all come from deprecated standard library APIs:reflect.Ptr→reflect.Pointerinpkg/x/markdown/accessibility_test.go.http.Transport.Dial/DialTLS→DialContext/DialTLSContextinpkg/api/http_client.go.The second fix changes the transport go-gh uses when
http_unix_socketis configured. In that setup, every request goes to a local unix socket instead of the network. No test covered this, so I added two tests, one for each dialer. Each starts a small HTTP server on a unix socket and requests a URL whose host can't resolve, so a response can only come from that server. One test requests anhttp://URL, which usesDialContext. The other requests anhttps://URL, which usesDialTLSContextand must reach the socket as plain HTTP.How did you test this change?
I ran
golangci-lint run ./...and saw the 4 findings before the change and0 issues.after it. The new tests pass both before and after the fix. When I removedDialContext, only thehttp://test failed. When I removedDialTLSContext, only thehttps://test failed.Key points
The tests put their sockets in
os.MkdirTempinstead oft.TempDir(), because macOS limits socket paths to 104 bytes and thet.TempDir()path is longer.Notes for reviewers
CI lints with golangci-lint v2.6.0, which may not report these findings. I found them with v2.14.0.
Authorship and follow-up
Who wrote this:
Who answers review comments: