aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/exec.go
diff options
context:
space:
mode:
authorNodir Turakulov <nodir@google.com>2015-10-13 21:34:47 -0700
committerAndrew Gerrand <adg@golang.org>2015-10-28 02:51:40 +0000
commit4038901b0f971f554f1a22db6e3e32c57637005b (patch)
treed87c15cfe73488e8bc3072e18854a12267c13235 /src/text/template/exec.go
parentbc3f14fd2afda8af73854104ac6a1cf42cef1519 (diff)
downloadgo-4038901b0f971f554f1a22db6e3e32c57637005b.tar.xz
text/template: remove redundant indirect
Change-Id: I8cc9783fd044bed48347824dcf973c61c78275a5 Reviewed-on: https://go-review.googlesource.com/15833 Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/text/template/exec.go')
-rw-r--r--src/text/template/exec.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/text/template/exec.go b/src/text/template/exec.go
index 233d34a02b..f45cbb212f 100644
--- a/src/text/template/exec.go
+++ b/src/text/template/exec.go
@@ -523,7 +523,7 @@ func (s *state) evalField(dot reflect.Value, fieldName string, node parse.Node,
return zero
}
typ := receiver.Type()
- receiver, _ = indirect(receiver)
+ receiver, isNil := indirect(receiver)
// Unless it's an interface, need to get to a value of type *T to guarantee
// we see all methods of T and *T.
ptr := receiver
@@ -535,7 +535,6 @@ func (s *state) evalField(dot reflect.Value, fieldName string, node parse.Node,
}
hasArgs := len(args) > 1 || final.IsValid()
// It's not a method; must be a field of a struct or an element of a map. The receiver must not be nil.
- receiver, isNil := indirect(receiver)
if isNil {
s.errorf("nil pointer evaluating %s.%s", typ, fieldName)
}