Categorygithub.com/ldemailly/panic-linter
repositorypackage
0.2.4
Repository: https://github.com/ldemailly/panic-linter.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Go Report Card GoDoc codecov CI Checks

panic-linter

paniccheck is a golang linter that flags panic() call that don't have a comment explaining why panic.

Why?

panic should only be used very sparingly, for catching bugs basically, and thus deserve a comment to confirm that that's indeed the case

bad:

  panic("catch this")

good:

  panic(fmt.Sprintf("bug: unexpected input=%v because...", input)) // Shouldn't happen unless we have bug