XR001

ResourcesExtra · tfsproutx

check for usage of ResourceData.GetOkExists() calls

The XR001 analyzer reports usage of GetOkExists() calls, which generally do not work as expected. Usage should be moved to standard Get() and GetOk() calls.

Examples

d.GetOkExists("example")
d.Get("example")

// or

d.GetOk("example")

Ignoring reports

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

//lintignore:XR001
d.GetOkExists("example")

This page is generated from xpasses/XR001/README.md, which lives beside the analyzer.