R009

ResourcesStandard

check for Go panic usage

The R009 analyzer reports usage of Go panics, which should be avoided. Any errors should be surfaced to Terraform, which will display them in the user interface and ensure any necessary state actions (e.g. cleanup) are performed as expected.

Examples

panic("oops")

log.Panic("eek")

log.Panicf("yikes")

log.Panicln("run away")
// Not present :)

Ignoring reports

Singular reports can be ignored by adding a //lintignore:R009 Go code comment at the end of the offending line or on the line immediately preceding, e.g.

//lintignore:R009
panic("oops")

This page is generated from passes/R009/README.md, which lives beside the analyzer.