Skip to content

Fix noctx lint warnings#38

Merged
JamieMagee merged 1 commit intomainfrom
jamiemagee/fix-noctx-lint
Feb 10, 2026
Merged

Fix noctx lint warnings#38
JamieMagee merged 1 commit intomainfrom
jamiemagee/fix-noctx-lint

Conversation

@JamieMagee
Copy link
Copy Markdown
Member

@JamieMagee JamieMagee commented Feb 10, 2026

Replace http.NewRequest with http.NewRequestWithContext and net.Listen with net.ListenConfig{}.Listen to satisfy the noctx linter.

The startup code in nuget_feed.go uses context.Background() since there's no incoming request context to propagate. Test files do the same.

Copilot AI review requested due to automatic review settings February 10, 2026 18:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes noctx linter warnings by replacing deprecated functions with their context-aware equivalents. The changes update http.NewRequest to http.NewRequestWithContext and net.Listen to net.ListenConfig{}.Listen, both using context.Background() which is appropriate for test code and initialization code where no upstream context exists.

Changes:

  • Replace deprecated http.NewRequest with http.NewRequestWithContext(context.Background(), ...) in tests and startup code
  • Replace deprecated net.Listen with net.ListenConfig{}.Listen(context.Background(), ...) in test setup
  • Add context import to all modified files

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
proxy_test.go Updated test helpers to use context-aware HTTP request and network listen functions
logging_test.go Updated test case to use http.NewRequestWithContext
internal/handlers/nuget_feed.go Updated NuGet feed initialization code to use context-aware HTTP requests
internal/handlers/git_server_test.go Updated multiple test cases to use http.NewRequestWithContext

@JamieMagee JamieMagee requested a review from truggeri February 10, 2026 18:21
@JamieMagee JamieMagee merged commit 80be702 into main Feb 10, 2026
176 of 181 checks passed
@JamieMagee JamieMagee deleted the jamiemagee/fix-noctx-lint branch February 10, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants