Skip to content

Latest commit

 

History

History

R019

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

R019

The R019 analyzer reports when there are a large number of arguments being passed to (*schema.ResourceData).HasChanges(), which it may be preferable to use (*schema.ResourceData).HasChangesExcept() instead.

Optional Arguments

  • -threshold=5 Number of arguments before reporting

Flagged Code

d.HasChanges("attr1", "attr2", "attr3", "attr4", "attr5")

Passing Code

d.HasChangesExcept("metadata_attr")

Ignoring Reports

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

//lintignore:R019
d.HasChanges("attr1", "attr2", "attr3", "attr4", "attr5")