aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/text/template/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/text/template/exec.go')
-rw-r--r--src/pkg/text/template/exec.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/text/template/exec.go b/src/pkg/text/template/exec.go
index 228477ce79..540fb72c8e 100644
--- a/src/pkg/text/template/exec.go
+++ b/src/pkg/text/template/exec.go
@@ -445,7 +445,7 @@ func methodByName(receiver reflect.Value, name string) (reflect.Value, bool) {
}
var (
- osErrorType = reflect.TypeOf((*error)(nil)).Elem()
+ errorType = reflect.TypeOf((*error)(nil)).Elem()
fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
)
@@ -659,7 +659,7 @@ func (s *state) printValue(n parse.Node, v reflect.Value) {
return
}
- if !v.Type().Implements(fmtStringerType) {
+ if !v.Type().Implements(errorType) && !v.Type().Implements(fmtStringerType) {
if v.CanAddr() && reflect.PtrTo(v.Type()).Implements(fmtStringerType) {
v = v.Addr()
} else {