Skip to content
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

cmd/gc: unhelpful error message for missing brace #5687

Closed
dsymonds opened this issue Jun 12, 2013 · 3 comments
Closed

cmd/gc: unhelpful error message for missing brace #5687

dsymonds opened this issue Jun 12, 2013 · 3 comments
Milestone

Comments

@dsymonds
Copy link
Contributor

http://play.golang.org/p/EHR4f5RduP

---
package main

func main() {
    var i int
    if (i == 0)
            i++   // <-- error on this line
}

---
prog.go:6: syntax error: unexpected semicolon or newline before {

---

I understand where the error message is coming from, but it's unhelpful and baffling for
Go newcomers. Let's get it fixed for the next release.
@rsc
Copy link
Contributor

rsc commented Jun 21, 2013

Comment 1:

I'm glad you know where the error is coming from, because I don't. I have no idea what {
that message is talking about.

@DanielMorsing
Copy link
Contributor

Comment 2:

The weird message is from go.errors. It assumes that the next token in this situation is
{.

@robpike
Copy link
Contributor

robpike commented Aug 19, 2013

Comment 3:

This issue was closed by revision d00bd1d.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@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

5 participants