Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

containedctx is a linter that detects struct contained context.Context field

License

NotificationsYou must be signed in to change notification settings

sivchari/containedctx

Repository files navigation

test_and_lint

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.

Instruction

go install github.com/sivchari/containedctx/cmd/containedctx@latest

Usage

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

CI

CircleCI

-run:name:install containedctxcommand:go install github.com/sivchari/containedctx/cmd/containedctx-run:name:run containedctxcommand:go vet -vettool=`which containedctx` ./...

GitHub Actions

-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

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp