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

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

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 added 2 commits 2024-04-27 13:01:42 +00:00
41795a7d06 [#1100] Add usage to `pubKey` field of Server
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
DCO action / DCO (pull_request) Successful in 5m10s Details
Vulncheck / Vulncheck (pull_request) Successful in 6m17s Details
Tests and linters / Lint (pull_request) Successful in 8m41s Details
Build / Build Components (1.22) (pull_request) Successful in 10m50s Details
Build / Build Components (1.21) (pull_request) Successful in 10m55s Details
Tests and linters / gopls check (pull_request) Successful in 11m14s Details
Tests and linters / Staticcheck (pull_request) Successful in 12m31s Details
Tests and linters / Tests (1.22) (pull_request) Successful in 13m25s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 14m12s Details
Tests and linters / Tests with -race (pull_request) Successful in 14m12s Details
e17fc60c13
[#1100] Remove unused fields
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
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

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

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

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 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
There is no content yet.