aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/template/exec.go')
-rw-r--r--src/text/template/exec.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/text/template/exec.go b/src/text/template/exec.go
index 19154fc640..4637b2035f 100644
--- a/src/text/template/exec.go
+++ b/src/text/template/exec.go
@@ -615,7 +615,7 @@ func (s *state) evalField(dot reflect.Value, fieldName string, node parse.Node,
tField, ok := receiver.Type().FieldByName(fieldName)
if ok {
field := receiver.FieldByIndex(tField.Index)
- if tField.PkgPath != "" { // field is unexported
+ if !tField.IsExported() {
s.errorf("%s is an unexported field of struct type %s", fieldName, typ)
}
// If it's a function, we must call it.