Skip to content

ci(deps): fix ineffassign and bodyclose in ".*_test.go$" #6777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2024

Conversation

mmorel-35
Copy link
Contributor

@mmorel-35 mmorel-35 commented May 25, 2024

Description

Fixes ineffassign and bodyclose issues in ".*_test.go$"

@mmorel-35 mmorel-35 changed the title ci(deps): fix ineffassign in ".*_test.go$" ci(deps): fix ineffassignand bodyclose in ".*_test.go$" May 25, 2024
@mmorel-35 mmorel-35 changed the title ci(deps): fix ineffassignand bodyclose in ".*_test.go$" ci(deps): fix ineffassign and bodyclose in ".*_test.go$" May 25, 2024
}

require.NoError(t, err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks better to me. Is there any advantage to your change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code is more simple than the new one but the two enabled linters seems to raise issues with that organisation.
The new one duplicate the code and allows to enable the linters for whole test files.
It could worth creating an issue in golangci-lint, bodyclose or ineffassign if you believe the linters are flaky ? Or maybe embed the if else logic in a dedicated method that might be able to trick the linters

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if it's annoying, we'll disable it later.

@knqyf263 knqyf263 added this pull request to the merge queue May 28, 2024
Merged via the queue into aquasecurity:main with commit 5ccfd17 May 28, 2024
12 checks passed
@mmorel-35 mmorel-35 deleted the ineffassign branch May 28, 2024 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants