R014

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: MPL-2.0 Imports: 5 Imported by: 2

README

R014

The R014 analyzer reports when CreateFunc, DeleteFunc, ReadFunc, and UpdateFunc declarations do not use d as the name for the *schema.ResourceData parameter or meta as the name for the interface{} parameter. This parameter naming is the standard convention for resources.

Flagged Code

func resourceExampleThingCreate(invalid *schema.ResourceData, meta interface{}) error { /* ... */ }

func resourceExampleThingRead(d *schema.ResourceData, invalid interface{}) error { /* ... */ }

func resourceExampleThingDelete(invalid *schema.ResourceData, invalid interface{}) error { /* ... */ }

Passing Code

func resourceExampleThingCreate(d *schema.ResourceData, meta interface{}) error { /* ... */ }

func resourceExampleThingRead(d *schema.ResourceData, meta interface{}) error { /* ... */ }

func resourceExampleThingDelete(d *schema.ResourceData, meta interface{}) error { /* ... */ }

Ignoring Reports

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

//lintignore:R014
func resourceExampleThingCreate(invalid *schema.ResourceData, meta interface{}) error { /* ... */ }

Documentation

Index

Constants

View Source
const Doc = `` /* 348-byte string literal not displayed */

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: analyzerName,
	Doc:  Doc,
	Requires: []*analysis.Analyzer{
		commentignore.Analyzer,
		crudfuncinfo.Analyzer,
	},
	Run: run,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL