aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql
diff options
context:
space:
mode:
authorJoe Taber <infogulch@gmail.com>2024-03-18 05:52:30 +0000
committerGopher Robot <gobot@golang.org>2024-03-18 21:31:46 +0000
commit1ed85ee228023d766b37db056311929c00091c9f (patch)
tree90c01b1a6b70bdd06afff790783e8450e0727b89 /src/database/sql
parent3bd95485ad64fa4d1c3732ad3b8bcb142841dbb7 (diff)
downloadgo-1ed85ee228023d766b37db056311929c00091c9f.tar.xz
text/template: simplify unwrapping reflect.Interface value
When text/template is evaluating a pipeline command and encounters an `interface{}`, it "digs down one level to the thing inside". Currently it does this with `value = reflect.ValueOf(value.Interface())`, which is unnecessary since it could just use `value = value.Elem()`. This commit changes it to use the latter. Why it was written that way is mysterious because the proposed change appears to be strictly better, but given the blame date (13 years ago) it may have been written while reflect was still in development before `Elem()` was added. Change-Id: I6c4f6283e78de07732c4120ce11f26f113fa46e4 GitHub-Last-Rev: bdfc6973ab227f951f244fda4d803da55fb49e71 GitHub-Pull-Request: golang/go#66373 Reviewed-on: https://go-review.googlesource.com/c/go/+/572355 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Rob Pike <r@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Diffstat (limited to 'src/database/sql')
0 files changed, 0 insertions, 0 deletions