Skip to content

Latest commit

 

History

History

R004

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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)