1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:54:43 -07:00

exp/template: improve error message for non-exported field.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4636086
This commit is contained in:
Rob Pike 2011-07-06 15:56:39 +10:00
parent a8e5db9449
commit 381a555f40

View File

@ -255,7 +255,7 @@ func (s *state) evalField(data reflect.Value, fieldName string) reflect.Value {
if field.IsValid() && isExported(fieldName) { // valid and exported if field.IsValid() && isExported(fieldName) { // valid and exported
return field return field
} }
s.errorf("%s has no field %s", data.Type(), fieldName) s.errorf("%s has no exported field %q", data.Type(), fieldName)
default: default:
s.errorf("can't evaluate field %s of type %s", fieldName, data.Type()) s.errorf("can't evaluate field %s of type %s", fieldName, data.Type())
} }