Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text/template: bad format string for range-over-int error #69708

Closed
jba opened this issue Sep 30, 2024 · 3 comments
Closed

text/template: bad format string for range-over-int error #69708

jba opened this issue Sep 30, 2024 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jba
Copy link
Contributor

jba commented Sep 30, 2024

Go version

go version devel go1.24-5fe3b31cf8 Fri Sep 27 16:45:09 2024 +0000 linux/amd64

Output of go env in your module/workspace:

GO111MODULE='on'                                                                                                               
GOARCH='amd64'
GOBIN=''
GOCACHE='/usr/local/google/home/jba/.cache/go-build'                                                                           
GOENV='/usr/local/google/home/jba/.config/go/env'
GOEXE=''
GOEXPERIMENT='fieldtrack,boringcrypto'
GOFLAGS=''
GOHOSTARCH='amd64'                                                                                                             
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/usr/local/google/home/jba/go/pkg/mod'                                                                             
GONOPROXY=''
GONOSUMDB=''                                                                                                                   
GOOS='linux'                                                                                                                   
GOPATH='/usr/local/google/home/jba/go'                                                                                         
GOPRIVATE=''
GOPROXY='https://proxy.golang.org'
GOROOT='/usr/lib/google-golang'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/google-golang/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23-20240626-RC01 cl/646990413 +5a18e79687 X:fieldtrack,boringcrypto'                                            
GODEBUG=''
GOTELEMETRY='on'                                                                                                               
GOTELEMETRYDIR='/usr/local/google/home/jba/.config/go/telemetry'                                                               
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'                                                                                                                     
CXX='clang++'                                                                                                                  
CGO_ENABLED='1'
GOMOD='/usr/local/google/home/jba/repos/github.com/jba/templatecheck/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2774739339=/tmp/go-build -gno-record-gcc-switches'

What did you do?

template.Must(ttmpl.New("").Parse(`{{range $x, $y := .}}{{.}}{{end}}`))

where template is text/template

What did you see happen?

template: :1:18: executing "" at <.>: can't use %!s(int=5) to iterate over more than one variable

(emphasis mine)

What did you expect to see?

maybe

template: :1:18: executing "" at <.>: can't use int=5 to iterate over more than one variable
@jba
Copy link
Contributor Author

jba commented Sep 30, 2024

Related to #66107.

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 30, 2024
@mknyszek mknyszek added this to the Backlog milestone Sep 30, 2024
callthingsoff added a commit to callthingsoff/go that referenced this issue Sep 30, 2024
Fixes golang#69708.

Change-Id: I8d7d10df4eed36cc76413d0645d89fe6e16f3296
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/616695 mentions this issue: text/template: use correct verbs for reflect.Value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants