Investigate unused
linter report with field-writes-are-uses
setting disabled #1100
Labels
No labels
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1100
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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.
Investigateto Investigateunused
linter report withfield-writes-are-uses
setting disabled.unused
linter report withfield-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
unused
linter warnings #373unused
linter report withfield-writes-are-uses
setting disabled #1111refs #1388