Skip to content
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

test: remove //nolint:govet comments #1729

Merged
merged 1 commit into from
Mar 2, 2024

Conversation

alexandear
Copy link
Contributor

This PR refactors the tests for noCopy structs, eliminating the need for //nolint:govet comments.

govet raises lint issues in tests on the reflect.DeepEqual(h1, h2) line where h1, h2 are of type Header. This is because Header contains the special field noCopy, which triggers govet. To appease govet, we can pass pointers to reflect.DeepEqual(&h1, &h2). According to the documentation, we can do this without breaking tests because "Pointer values are deeply equal if they are equal using Go's == operator or if they point to deeply equal values."

@alexandear alexandear changed the title test: remove //nolint:govet comments in tests test: remove //nolint:govet comments Mar 1, 2024
@erikdubbelboer erikdubbelboer merged commit bdd459a into valyala:master Mar 2, 2024
15 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks!

@alexandear alexandear deleted the test-remove-nolint-govet branch March 2, 2024 15:57
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.

None yet

2 participants