Skip to content

Compiler diagnostic when a semicolon is missing should be more detailed. #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jaguilar opened this issue Nov 12, 2009 · 2 comments
Closed

Comments

@jaguilar
Copy link

The optional semicolon is a possible tripping point for people new to Go language. Since
it 
seems that changing it to be required will not happen, we should have good diagnostics
to help 
people know when it has been omitted incorrectly.

Consider foo.go:

package main
func main() {
    i := 1
    i = i + i
}

If you do 6g foo.go, the error message printed is:

$ 6g foo.go
foo.go:4: syntax error near i

The error message should be more detailed since new users may have trouble finding the 
problem:

foo.go:4: statements in functions must be separated by semicolons
@rsc
Copy link
Contributor

rsc commented Nov 12, 2009

Comment 1:

Status changed to Duplicate.

Merged into issue #89.

@rsc
Copy link
Contributor

rsc commented Dec 11, 2009

Comment 2:

This issue was closed by revision 3997495.

Status changed to Fixed.

Merged into issue #-89.

@jaguilar jaguilar added the fixed label Dec 11, 2009
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants