Contributions are partitioned by the check (diagnostic) names.
By the "contribution", we mean all of these:
- Commit that fixes the problem
- Reported issue (if there is no commit yet)
- Any other form of advice that was suggested by
go-critic
The list is sorted by priority. If commit exist, it should be referenced instead of issue. If issue exist, is should be referenced (as opposed of 3 where we have no explicit issue ticket).
This page exists mostly to determine most useful checks that can trigger on real projects.
These checks are a good candidates to be included into "default" go-critic
list.
Most projects listed here have high base code quality, so every detected issue counts.
Note that this list is not comprehensive. It's virtually impossible to keep track of all contributions were made.
- {gohugoio/hugo} tpl: Fix strings.HasPrefix args order
- {syncthing/syncthing} cmd/syncthing: Correct strings.HasPrefix args order
- {etcd-io/etcd} Fix strings.HasPrefix args order
- {goreleaser/goreleaser} fix: brew strings.HasPrefix args order
- {golang/go} net/rpc: fix args order in strings.Contains call
- {golang/go} cmd/compile/internal/ssa: fix partsByVarOffset.Less method
- {securego/gosec} fix duplicated index issue in Less method
- {golang/go} cmd/link/internal/sym: uncomment code for ELF cases in RelocName
- {go-kit/kit} metrics: remove commented-out debug code
- {Microsoft/DUCK} backend/ducklib: remove commentedOutCode from server.go
- {Microsoft/DUCK} backend/ducklib/handlers/documents: remove commented-out debug code
- {Microsoft/KubeGPU} crishim/pkg/kubeadvertise: remove commented-out code
- {future-architect/vuls} config: remove commented-out code from tomlloader
- {golang/dep} cmd/dep,gps: remove commented-out code
- {ncw/rclone} all: fix go-critic linter suggestions
- {v2ray/v2ray-core} s/len/length/ s/cap/capacity/ to avoid builtin shadowing
- {mvdan/sh} syntax: replace if-else chains with expr switch stmt
- {afiskon/go-elector} minor style fixes
- {google/go-cloud} all: simplify and clarify some expressions
- {v2ray/v2ray-core} app/router: rewrite if-else chain to switch
- {jinzhu/gorm} rewrite if-else chain as switch statement
- {golang/go} runtime: remove redundant explicit deref in trace.go
- {google/go-github} Remove redundant dereference of time.Time
- {ncw/rclone} all: fix go-critic linter suggestions
- {golang/go} runtime: simplify slice expression to sliced value itself
- {ncw/rclone} all: fix go-critic linter suggestions
- {src-d/gitbase} internal/rule: simplify slice expression to sliced value itself
- {Microsoft/opengcs} service/gcsutil/gcstools: simplify slice expression to sliced value itself
- {future-architect/vuls} commands: simplify slice expression to sliced value itself
- {grafeas/grafeas} Simplify slicing of s to s where s is a slice
- {influxdata/influxdb} Simplify slicing of s to s where s is a slice
- {sourcegraph/sourcegraph} Simplify slicing of s to s where s is a slice
- {golang/go} cmd/internal/obj/arm64: simplify some bool expressions
- {coreos/etcd} etcdserver/api/v2discovery: simplify !(x == y) to x != y
- {openshift/origin} build/controller/build: simplify bool exprs
- {google/go-cloud} all: simplify and clarify some expressions
- {beego/beego} all: simplify boolean expressions
- {golang/dep} gps: simplify boolean expression
- {golang/go} math,net: omit explicit true tag expr in switch
- {src-d/gitbase} internal/rule: simplify
switch true {...}
toswitch {...}
- {golang/go} archive/tar: remore redundant parens in type expressions
- {upspin/upspin} pack/internal/packtest: remove redundant parens in type conv
- {ncw/rclone} all: fix go-critic linter suggestions
- {src-d/gitbase} remove redundant parenthesis
- {golang/go} strings, bytes: avoid unnecessary function literals
- {gobufallo/buffalo} internal/release,render: remove redundant func wrapping
- {openshift/origin} apps: replace func lits with wrapped func value
- {go-kit/kit} metrics/internal/convert: use method value insetad of lambda
- {golang/dep} gps: replace redundand lambda wrapper with method value
- {gobufallo/buffalo} buffalo/cmd: make len comparison more clear
- {graphql-go/graphql} replace len(x)<=v with len(x)==v
- {securego/gosec} replace len(x)<=0 with len(x)==0
- {go-gitea/gitea} Remove check for negative length
- {go-kit/kit} sd/lb: replace len(x)<=0 with len(x)==0
- {golang/dep} cmd/dep: replace
len(x)<=0
withlen(x)==0
- {graphql-go/graphql} use type switch with var binding
- {intel-go/nff-go} Modified style in merge function
- {ethereum/go-ethereum} all: simplify switches
- {google/go-cloud} all: simplify and clarify some expressions
- {go-gitea/gitea} Use type switch
- {graphql-go/graphql} simplify single case type switches
- {mvdan/sh} interp,syntax: replace single case switches
- {go-reform/reform} parse: replace 1 case switch with if
- {minio/minio} simplifying if-else chains to switches
- {ethereum/go-ethereum} all: simplify switches
- {Microsoft/KubeGPU} utils: replace single case type switch with if
- {graphql-go/graphql} simplify assignments with op= syntax
- {go-kit/kit} metrics/teststat: replace
x = x <op> y
withx <op>= y
- {Microsoft/KubeGPU} plugins: simplify
x = x <op> y
tox <op>= y
- {future-architect/vuls} report: simplify
x = x <op> y
tox <op>= y
- {golang/dep} gps: simplify
x = x <op> y
tox <op>= y
- {lucas-clemente/quic-go} simplify
x = x <op> ...
tox <op>= ...