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

Analyzer: nilerr checks returning nil when err is not nil

License

NotificationsYou must be signed in to change notification settings

golangci/nilerr

 
 

Repository files navigation

pkg.go.dev

nilerr finds code which returns nil even though it checks that error is not nil.

funcf()error {err:=do()iferr!=nil {returnnil// miss}}

nilerr also finds code which returns error even though it checks that error is nil.

funcf()error {err:=do()iferr==nil {returnerr// miss}}

nilerr ignores code which has a miss with ignore comment.

funcf()error {err:=do()iferr!=nil {//lint:ignore nilerr reasonreturnnil// ignore}}

How to use

$ go install github.com/gostaticanalysis/nilerr/cmd/nilerr@latest$ nilerr ./...

About

Analyzer: nilerr checks returning nil when err is not nil

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go97.3%
  • Makefile2.7%

[8]ページ先頭

©2009-2025 Movatter.jp