mirror of
https://github.com/golang/go
synced 2024-11-22 00:24:41 -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:
parent
a8e5db9449
commit
381a555f40
@ -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())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user