You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing this well requires some care and is not trivial - it may not be worth the effort. For instance, if the code would have been
func main() {
for := "f"; g(); {}
// ...
}
it's not even clear what the error should be: When the compiler sees the for it assumes a for loop, and the error might be that there's a missing identifier after the for. Or it might be that for was taken as an identifier.
Given that Go has only 25 identifiers, it's not unreasonable to assume that Go programmers actually know them all.
Leaving open for now, in case somebody wants to play with this.
I saw a new programmer struggle with the following:
which is an invalid program since
map
is a keyword.However, the error being printed is currently:
It should really print a more helpful error message:
/cc @griesemer
The text was updated successfully, but these errors were encountered: