]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
text/template: fix slice builtin for pointers to arrays
authorNathan Nguyen <nhan13574@gmail.com>
Fri, 5 Dec 2025 20:50:24 +0000 (15:50 -0500)
committerSean Liao <sean@liao.dev>
Mon, 15 Dec 2025 17:04:58 +0000 (09:04 -0800)
commitb7944a5f80b5aa7ad43730064cf4ebc8c473df47
tree73fb7579a3739f294df81f087f84928e3d0c237e
parent6713f46426c70f601ac33471d16be7b0e1aae349
text/template: fix slice builtin for pointers to arrays

The slice function now properly handles pointers to arrays by calling
indirect() to dereference pointers, matching the behavior of the index
function.

Fixes #39596

Change-Id: Id4920edbfd8fd3df3a181b59a61733f88b0f104d
Reviewed-on: https://go-review.googlesource.com/c/go/+/727400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/text/template/exec_test.go
src/text/template/funcs.go