What version of Go are you using (go version)?
1.8
What operating system and processor architecture are you using (go env)?
any
What did you do?
Attempt to call init()
https://play.golang.org/p/enueQhZnFA
What did you expect to see?
An error message indicating that you cannot call init; despite it appearing as a normal function in the source, it is actually a reserved function name that isn't actually declared / callable. To a newcomer who accidentally names a function init, this would be much more insightful.
What did you see instead?
main.go:12: undefined: init
What version of Go are you using (
go version)?1.8
What operating system and processor architecture are you using (
go env)?any
What did you do?
Attempt to call init()
https://play.golang.org/p/enueQhZnFA
What did you expect to see?
An error message indicating that you cannot call
init; despite it appearing as a normal function in the source, it is actually a reserved function name that isn't actually declared / callable. To a newcomer who accidentally names a functioninit, this would be much more insightful.What did you see instead?