valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.91k stars 1.76k forks source link

Change empty string checks to be more idiomatic #1683

Closed alexandear closed 11 months ago

alexandear commented 11 months ago

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".