diff options
| author | Emmanuel T Odeke <emmanuel@orijtech.com> | 2024-11-07 17:40:08 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-11-08 16:09:21 +0000 |
| commit | 64e7f66b26d7e5a9d4a003e7867a5dcf939bba6d (patch) | |
| tree | 17fdf7d1c352e09a00526fbd3a48a7b4ffd98229 /src/text/template/exec.go | |
| parent | 2b33434287be85917ba8edc4a73f0a6ebaaea63e (diff) | |
| download | go-64e7f66b26d7e5a9d4a003e7867a5dcf939bba6d.tar.xz | |
encoding/json, text/template: use reflect.Value.Equal instead of ==
This change applies a fix for a reflect.Value incorrect comparison
using "==" or reflect.DeepEqual.
This change is a precursor to the change that'll bring in the
static analyzer "reflectvaluecompare", by ensuring that all tests
pass beforehand.
Updates #43993
Change-Id: I6c47eb0a1de6353ac7495cb8cb49b318b7ebba56
Reviewed-on: https://go-review.googlesource.com/c/go/+/626116
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/text/template/exec.go')
| -rw-r--r-- | src/text/template/exec.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/text/template/exec.go b/src/text/template/exec.go index 872d8aaa0c..57f076e35f 100644 --- a/src/text/template/exec.go +++ b/src/text/template/exec.go @@ -810,7 +810,7 @@ func (s *state) evalCall(dot, fun reflect.Value, isBuiltin bool, node parse.Node return v } } - if final != missingVal { + if !final.Equal(missingVal) { // The last argument to and/or is coming from // the pipeline. We didn't short circuit on an earlier // argument, so we are going to return this one. |
