Skip to content

Latest commit

 

History

History

R002

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

R002

The R002 analyzer reports likely extraneous uses of star (*) dereferences for a Set() call. The Set() function automatically handles pointers and * dereferences without nil checks can panic.

Flagged Code

var stringPtr *string

d.Set("example", *stringPtr)

Passing Code

var stringPtr *string

d.Set("example", stringPtr)

Ignoring Reports

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

var stringPtr *string

//lintignore:R002
d.Set("example", *stringPtr)