Investigate unused linter report with field-writes-are-uses setting disabled #1111

Merged
fyrchik merged 1 commit from elebedeva/frostfs-node:fix/unused-linter into master 2024-05-06 08:28:32 +00:00
Member

Close #1100

The investigation revealed several cases of false-positive results:

  1. Known issue of struct being used as a map key without any field access occurred 3 times:
cmd/frostfs-node/policy_engine.go:28 , 29
pkg/util/locode/table/csv/calls.go:59 , 60
pkg/services/session/storage/temporary/storage.go:12 , 13

Therefore leaving field-writes-are-uses enabled as it is by default.

Removed unnecessary unused fields.

Close #1100 The investigation revealed several cases of false-positive results: 1. Known issue of struct being used as a map key without any field access occurred 3 times: ``` cmd/frostfs-node/policy_engine.go:28 , 29 pkg/util/locode/table/csv/calls.go:59 , 60 pkg/services/session/storage/temporary/storage.go:12 , 13 ``` Therefore leaving `field-writes-are-uses` enabled as it is by default. Removed unnecessary unused fields.
elebedeva added the
internal
label 2024-04-27 13:01:33 +00:00
elebedeva requested review from storage-core-committers 2024-04-27 13:02:02 +00:00
elebedeva requested review from storage-core-developers 2024-04-27 13:02:04 +00:00
acid-ant approved these changes 2024-04-27 13:08:24 +00:00
achuprov approved these changes 2024-04-27 13:21:52 +00:00
fyrchik reviewed 2024-04-27 13:42:33 +00:00
@ -70,3 +70,3 @@
// internal variables
key *keys.PrivateKey
pubKey []byte
pubKey *keys.PublicKey
Owner

Frankly, I would remove it completely, there is no need to cache it, getting public key from the private is free, no calculations required https://pkg.go.dev/crypto/ecdsa#PrivateKey

Frankly, I would remove it completely, there is no need to cache it, getting public key from the private is free, no calculations required https://pkg.go.dev/crypto/ecdsa#PrivateKey
Owner

even more so, we now have 2 different sources for public key, which can diverge in future

even more so, we now have 2 different sources for public key, which _can_ diverge in future
Owner

raw bytes made sense, when it was marshaled a lot, to reduce allocations

raw bytes made sense, when it was marshaled a lot, to reduce allocations
aarifullin approved these changes 2024-05-02 07:53:17 +00:00
dstepanov-yadro approved these changes 2024-05-02 07:58:37 +00:00
elebedeva force-pushed fix/unused-linter from e17fc60c13 to e07869a8cf 2024-05-06 07:15:07 +00:00 Compare
fyrchik approved these changes 2024-05-06 08:28:25 +00:00
fyrchik merged commit e07869a8cf into master 2024-05-06 08:28:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1111
No description provided.