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.
-threshold=5
Number of arguments before reporting
d.HasChanges("attr1", "attr2", "attr3", "attr4", "attr5")
d.HasChangesExcept("metadata_attr")
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")