- Notifications
You must be signed in to change notification settings - Fork4
containedctx is a linter that detects struct contained context.Context field
License
NotificationsYou must be signed in to change notification settings
sivchari/containedctx
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
containedctx is a linter that detects struct contained context.Context field.This is discouraged technique in favour of passing context as first argument of method or function.For rationale please readContexts and structs the Go blog post.
go install github.com/sivchari/containedctx/cmd/containedctx@latest
package mainimport"context"typeokstruct {iintsstring}typengstruct {ctx context.Context}typeemptystruct{}
go vet -vettool=(which containedctx) ./...#a./main.go:11:2: found a struct that contains a context.Context field
-run:name:install containedctxcommand:go install github.com/sivchari/containedctx/cmd/containedctx-run:name:run containedctxcommand:go vet -vettool=`which containedctx` ./...
-name:install containedctxrun:go install github.com/sivchari/containedctx/cmd/containedctx-name:run containedctxrun:go vet -vettool=`which containedctx` ./...
About
containedctx is a linter that detects struct contained context.Context field
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.