Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: goto over type/const declarations is erroneously rejected #19088
The Go spec (section "Goto statements") says "Executing the "goto" statement must not cause any variables to come into scope that were not already in scope at the point of the goto."
cmd/compile erroneously rejects this code:
referenced this issue
Feb 14, 2017
@dr2chase Sorry, I'm not sure I understand your question.
The Go spec forbids gotos that jump over variable declarations such as:
The issue is that cmd/compile (and gccgo) are also rejecting gotos that jump over type and constant declarations.