contextcheck icon indicating copy to clipboard operation
contextcheck copied to clipboard

Analyzer: check whether a function uses a non-inherited context

Results 8 contextcheck issues
Sort by recently updated
recently updated
newest added

Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.19.0 to 0.20.0. Commits 11c692e gopls/internal/test/marker/testdata: skip hover size tests on 32-bit arm fc660e5 go.mod: update golang.org/x dependencies 6590f47 internal/gcimporter: renable tests of issue50259.go f1d5252 gopls/internal/golang: Hover:...

dependencies

In the following function ``` func (d *storage) WithTransaction( ctx context.Context, fn func(context.Context) error, ) error { sess, err := d.client.StartSession() if err != nil { return err } defer...

Hi, I don't understand why this code should be flagged. Any explanation or realistic reason would be appreciated for going deep to raise the flag. Thanks ```go // github.com/go-chi/chi/v5 //...

I have code that looks like: ``` import ( "net/http" "go.opencensus.io/trace" ) func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { defer func() { span := trace.FromContext(r.Context()) _ = span }()...

question

The following fails when I plug it into contextcheck’s test suite: ``` package customcontext import ( "context" "time" ) var _ context.Context = &MyContext{} func f1(ctx context.Context) { passesContextTODO() //...

I have some false positives on the code, which is not in my control. Can you stop analysis, if the error occurs in 3rd party libraries? ## Example ```go import...

After commit a2c3e11b3e140252fe2ff774b9e3435e29361690, v1.0.8, I'm getting reports that I think are false positives. There's an underlying function ```go func WriteProblem(w http.ResponseWriter, r *http.Request, problem *Problem, originalError error) error ``` ...which...

Simplified example: ```go // Run runs server until ctx is canceled, then stops it gracefully and exits. func RunHandler(ctx context.Context) { s := http.Server{ BaseContext: func(_ net.Listener) context.Context { return...

good first issue