Open rliebz opened 13 hours ago
Hi @rliebz thanks for reporting the problem. I'll take a look
@chavacava can you please check my PR?
@chavacava can you please check my PR?
Yes, no problem but please in the future assign you the issue before start working on it.
@chavacava yeah, sorry, missed that.
Describe the bug The
var-declaration
check incorrectly warns if explicitly assigning a zero value in avar
declaration, even if the zero value being assigned isn't the default for a variable of that type.To Reproduce Steps to reproduce the behavior:
go install github.com/mgechev/revive@latest
main.go:
Expected behavior I would expect no errors for
var-declaration
, because the zero value for a variable of typeany
isnil
, not0
or""
.Logs
Desktop (please complete the following information):
go version go1.23.3 darwin/arm64
Additional context N/A