Investigate unused
linter report with field-writes-are-uses
setting disabled #1100
Labels
No Label
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1100
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
unused
linter has afield-writes-are-uses
setting, which is true by default.The default differs from
structcheck
behaviour which catches struct fields that are only written to.There are some false-positives here (e.g. in
cmd/frostfs-node/policy-engine.go
where the struct is used as a map key without any field access).So I suggest:
linter-settings
and add an exception in code.Note that not all of the fields need to be removed, we can have some bugs here (e.g. config parameter being unused). The bugs should be fixed in separate commits.
Investigate `unused` linter report with `field-writes-are-uses` setting disabled.to Investigate `unused` linter report with `field-writes-are-uses` setting disabledThere are other problems as well https://github.com/dominikh/go-tools/issues/288, so leaving the setting in default is a good idea.
The false positive from OP is known about https://github.com/dominikh/go-tools/issues/288#issuecomment-1371631522