1
0
mirror of https://github.com/golang/go synced 2024-09-29 02:24:33 -06:00
Commit Graph

2 Commits

Author SHA1 Message Date
Russ Cox
85e3c9e6b8 cmd/compile, go/types: omit needless word in error message
CL 21462 and CL 21463 made this message say explicitly that the problem
was a struct field in a map, but the word "directly" is unnecessary,
sounds wrong, and makes the error long.

Change-Id: I2fb68cdaeb8bd94776b8022cf3eae751919ccf6f
Reviewed-on: https://go-review.googlesource.com/23373
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-05-24 15:07:16 +00:00
Caio Marcelo de Oliveira Filho
f229e46783 cmd/compile: better error when assigning to struct field in map
Identify this assignment case and instead of the more general error

    prog.go:6: cannot assign to students["sally"].age

produce

    prog.go:6: cannot directly assign to struct field students["sally"].age in map

that explains why the assignment is not possible.

Fixes #13779.

Change-Id: I90c10b445f907834fc1735aa66e44a0f447aa74f
Reviewed-on: https://go-review.googlesource.com/21462
Reviewed-by: David Chase <drchase@google.com>
2016-04-04 14:07:47 +00:00