R004

package
v0.15.0 Latest Latest
Warning

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

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

README

R004

The R004 analyzer reports incorrect types for a Set() call value. The Set() function only supports a subset of basic types, slices and maps of that subset of basic types, and the schema.Set type.

Flagged Code

var t time.Time

d.Set("example", t)

Passing Code

var t time.Time

d.Set("example", t.Format(time.RFC3339))

Ignoring Reports

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

var t time.Time

//lintignore:R004
d.Set("example", t)

Documentation

Overview

Package R004 defines an Analyzer that checks for ResourceData.Set() calls using incompatible value types

Index

Constants

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

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: analyzerName,
	Doc:  Doc,
	Requires: []*analysis.Analyzer{
		resourcedatasetcallexpr.Analyzer,
		commentignore.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