refactoring: make unused linter stricker #1388

Merged
dstepanov-yadro merged 15 commits from dstepanov-yadro/frostfs-node:refactoring/drop_unused into master 2024-09-25 08:55:39 +00:00
2 changed files with 4 additions and 0 deletions
Showing only changes of commit 62c8e6554c - Show all commits

View file

@ -7,6 +7,8 @@ import (
)
type RawEntry struct {
// key and value used for record dump.

@a-savchuk please review

@a-savchuk please review
// nolint:unused
key, value []byte
a-savchuk marked this conversation as resolved Outdated

For a raw entry, as for any entry, we wanna be able to see its dump (see DetailedString method). Both fields key and value are intended to be shown in a dump view. Could we ignore the lint warning here? or should we do something trickier like this

func (r *RawEntry) DetailedString() string {
	_ = r.value // both value and key need to be used in dump 
	return spew.Sdump(r)
}

and add an additional comment to describe that decision?

For a raw entry, as for any entry, we wanna be able to see its dump (see `DetailedString` method). Both fields `key` and `value` are intended to be shown in a dump view. Could we ignore the lint warning here? or should we do something trickier like this ```go func (r *RawEntry) DetailedString() string { _ = r.value // both value and key need to be used in dump return spew.Sdump(r) } ``` and add an additional comment to describe that decision?
Review

fixed

fixed
}

View file

@ -16,6 +16,8 @@ type (
DefaultRecord struct {
addr oid.Address
// data used for record dump.
// nolint:unused
data []byte
a-savchuk marked this conversation as resolved Outdated

Same comment as the one for RawEntry. We should keep that field for DetailedString method

Same comment as the one for `RawEntry`. We should keep that field for `DetailedString` method
Review

fixed

fixed
}
)