refactoring: make unused linter stricker #1388
2 changed files with 4 additions and 0 deletions
|
@ -7,6 +7,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type RawEntry struct {
|
type RawEntry struct {
|
||||||
|
// key and value used for record dump.
|
||||||
|
|||||||
|
// nolint:unused
|
||||||
key, value []byte
|
key, value []byte
|
||||||
a-savchuk marked this conversation as resolved
Outdated
a-savchuk
commented
For a raw entry, as for any entry, we wanna be able to see its dump (see
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?
dstepanov-yadro
commented
fixed fixed
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@ type (
|
||||||
|
|
||||||
DefaultRecord struct {
|
DefaultRecord struct {
|
||||||
addr oid.Address
|
addr oid.Address
|
||||||
|
// data used for record dump.
|
||||||
|
// nolint:unused
|
||||||
data []byte
|
data []byte
|
||||||
a-savchuk marked this conversation as resolved
Outdated
a-savchuk
commented
Same comment as the one for Same comment as the one for `RawEntry`. We should keep that field for `DetailedString` method
dstepanov-yadro
commented
fixed fixed
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue
@a-savchuk please review