In Go nil is not a keyword. It is a predeclared identifier (https://go.dev/ref/spec#Predeclared_identifiers). Code is permitted to shadow the predeclared identifiers, and that is what is happening here.
Closing because this is not a bug. In general we suggest asking questions on a forum; see https://go.dev/wiki/Questions. Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (1.18)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See at https://gotipplay.golang.org/p/Zb7hPmoxFj0 and https://go.dev/play/p/Zb7hPmoxFj0
What did you expect to see?
Compile errors
What did you see instead?
Everything is working
The text was updated successfully, but these errors were encountered: