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

Change empty string checks to be more idiomatic #1684

Merged

Conversation

alexandear
Copy link
Contributor

This PR refactors code by changing if len(str) == 0 { to more idiomatic if str == "" {. Additionally, enables gocritic's emptyStringTest check to prevent such code in the future.

See "Empty string check".

@erikdubbelboer erikdubbelboer merged commit 28615eb into valyala:master Jan 4, 2024
14 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks!

@alexandear alexandear deleted the gocritic-empty-string-test branch January 4, 2024 14:48
Max-Cheng added a commit to Max-Cheng/fasthttp that referenced this pull request Feb 11, 2024
Max-Cheng added a commit to Max-Cheng/fasthttp that referenced this pull request Feb 12, 2024
Max-Cheng added a commit to Max-Cheng/fasthttp that referenced this pull request Feb 12, 2024
Max-Cheng added a commit to Max-Cheng/fasthttp that referenced this pull request Feb 12, 2024
Max-Cheng added a commit to Max-Cheng/fasthttp that referenced this pull request Feb 12, 2024
Max-Cheng added a commit to Max-Cheng/fasthttp that referenced this pull request Feb 12, 2024
erikdubbelboer added a commit that referenced this pull request Feb 21, 2024
* feat:support zstd compress and uncompressed

* fix:real & stackless write using different pool to avoid get stackless.writer

* fix:zstd normalize compress level

* Change empty string checks to be more idiomatic (#1684)

* chore:lint fix and rebase with master

* chore:remove 1.18 test & upgrade compress version

* fix:error default compress level

* Fix lint

---------

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
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