diff --git a/plugins/common/starlark/field_dict.go b/plugins/common/starlark/field_dict.go index 746a2ca9f..5356a2de9 100644 --- a/plugins/common/starlark/field_dict.go +++ b/plugins/common/starlark/field_dict.go @@ -38,6 +38,10 @@ func (d FieldDict) Type() string { } func (d FieldDict) Freeze() { + // Disable linter check as the frozen variable is modified despite + // passing a value instead of a pointer, because `FieldDict` holds + // a pointer to the underlying metric containing the `frozen` field. + //revive:disable:modifies-value-receiver d.frozen = true } diff --git a/plugins/common/starlark/tag_dict.go b/plugins/common/starlark/tag_dict.go index 56ee0f655..992d5b298 100644 --- a/plugins/common/starlark/tag_dict.go +++ b/plugins/common/starlark/tag_dict.go @@ -37,6 +37,10 @@ func (d TagDict) Type() string { } func (d TagDict) Freeze() { + // Disable linter check as the frozen variable is modified despite + // passing a value instead of a pointer, because `TagDict` holds + // a pointer to the underlying metric containing the `frozen` field. + //revive:disable:modifies-value-receiver d.frozen = true }