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
bradfitz
changed the title
Bad gofmt error message on extra comma in struct type
go/parser: bad gofmt error message on extra comma in struct type
Sep 1, 2015
On some bad code, gofmt gives a confusing error while the compiler gives a nice one.
Online demo at http://play.golang.org/p/htmZpN6HcY (click "format"), also inlined here to keep the bug self-contained.
The issue is the comma.
Format says
6:7: expected expression (and 3 more errors)
, which points at the "struct" keyword.Run says
prog.go:7: syntax error: unexpected comma, expecting }
, which is a good error message.The text was updated successfully, but these errors were encountered: