Enable unparam and unconvert linters #1598
No reviewers
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 milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1598
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/add_linters"
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?
Add
unparam
andunconvert
linters to make code cleaner.a4481ddb4d
to6d18cbd791
unparam
looks awesome🔥Did you consider another scope for your commit message? For example,
golangci
orci
Here are some of your commits from the past
6d18cbd791
tofb928616cc
Done
@ -30,6 +30,8 @@ type InhumePrm struct {
// InhumeRes encapsulates results of inhume operation.
type InhumeRes struct{}
var inhumeRes = InhumeRes{}
Why was this a problem?
Linter says that all return values of
InhumeRes
are the same, so this looks like there is no return value requered.But we have an unspoken agreement to return the result and the error.
To make everyone happy, a global variable was introduced.
I thought this was the reason we wanted this linter: what about removing
Res
struct where it is not needed?This global variable looks like
lint:ignore
and may introduce problems later (were we to add a field and modify it somehow).You're trying to destroy long-standing foundations!
I am trying to refine them.
The addition of this linter is a worthy reason.
Ok, fixed
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings