You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ 1 2 }} yields an error (as I'd expect) but {{ (1) 2 }} outputs 1 without an error.
System details
go version go1.12.4 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/julian/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/julian/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version go1.12.4 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.12.4
uname -sr: Linux 5.0.9-arch1-1-ARCH
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
/usr/lib/libc.so.6: GNU C Library (GNU libc) stable release version 2.29.
gdb --version: GNU gdb (GDB) 8.2.1
The text was updated successfully, but these errors were encountered:
julianbrost
changed the title
Unintuitive behavor of parenthesized arguments in text/template and html/template
Unintuitive behavior of parenthesized arguments in text/template and html/template
May 2, 2019
katiehockman
changed the title
Unintuitive behavior of parenthesized arguments in text/template and html/template
text/template: unintuitive behavior of parenthesized arguments in text/template and html/template
May 3, 2019
This caused 35 test failures in Google internal code,
so it's worth mentioning in the release notes.
Updates #31810
Updates #36878Fixes#37066
Change-Id: I2faa6bce4c7d735107eceaef7d95223844846454
Reviewed-on: https://go-review.googlesource.com/c/go/+/217978
Reviewed-by: Rob Pike <r@golang.org>
dmitshur
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Dec 15, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What did you do?
Execute a template like
{{ (1) 2 }}
withtext/template
andhtml/template
. Full example on Go Playground: https://play.golang.org/p/nDdB_6tzx8GWhat did you expect to see?
I'd expect
{{ 1 2 }}
and{{ (1) 2 }}
to behave the same.The last item at https://golang.org/pkg/text/template/#hdr-Arguments reads like parenthesizing a single argument should have no effect.What did you see instead?
{{ 1 2 }}
yields an error (as I'd expect) but{{ (1) 2 }}
outputs1
without an error.System details
The text was updated successfully, but these errors were encountered: