httpnoctx

package
v0.85.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package httpnoctx implements a Go analysis linter that flags HTTP calls that do not accept a context.Context: (*http.Client).Get, .Head, .Post, .PostForm and the package-level http.Get/Head/Post/PostForm shortcuts. It also flags http.NewRequest inside functions that already receive context.Context, and http.DefaultClient.Do which uses a timeout-less client. The fix is to build the request with http.NewRequestWithContext and use a client with a timeout so cancellation and deadline are propagated.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = analyzerutil.New("httpnoctx", "reports context-free net/http request paths: http.Client/http package helpers without context, http.NewRequest in context-aware functions, and http.DefaultClient.Do", run)

Analyzer is the http-no-ctx analysis pass.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL