mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.69k stars 269 forks source link

enforce-slice-style: Support nil declaration enforcement #974

Closed jalaziz closed 4 months ago

jalaziz commented 4 months ago

Add support for enforcing nil slice declarations as recommended by both the Go Code Review and Uber style guides.

This initial version is quite strict in that it also prevents using empty literal and make-style slices in struct assignments and as function arguments.

Closes #971

denisvmedia commented 4 months ago

Thank you for your PR @jalaziz , do you mind also updating the docs?

jalaziz commented 4 months ago

Thank you for your PR @jalaziz , do you mind also updating the docs?

Done, let me know if you'd like me to add more detail 🙏🏼

chavacava commented 4 months ago

LGTM