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
Using := assignment on a struct field gives a helpful message from gc, but less helpful
from gofmt.
From gc: prog.go:12: non-name t.a on left side of :=
From gofmt: prog.go:12:2: expected identifier
http://play.golang.org/p/Ajrytiavn_
--------------------
package main
import "fmt"
type T struct {
a int
b int
}
func main() {
var t T
t.a := 7 // here is the error
fmt.Println(t)
}
The text was updated successfully, but these errors were encountered:
I agree that go/parser should do a better job here. It's especially important since so
many tools parse the Go code with go/parser before passing it to gc.
The text was updated successfully, but these errors were encountered: