Skip to content

text/template: missingkey option lost when cloning a template #60100

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

Closed
simonhege opened this issue May 10, 2023 · 1 comment
Closed

text/template: missingkey option lost when cloning a template #60100

simonhege opened this issue May 10, 2023 · 1 comment

Comments

@simonhege
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.20.4 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\shege\AppData\Local\go-build
set GOENV=C:\Users\shege\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\shege\go\pkg\mod
set GOOS=windows
set GOPATH=C:\Users\shege\go
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.4
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=C:\Users\shege\orms\helm\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\shege\AppData\Local\Temp\go-build75438669=/tmp/go-build -gno-record-gcc-switches

What did you do?

Create a template with option "missingkey=zero" or "missingkey=error"
Clone the template
Execute both template with same data, where we fall in the missing key scenario.

https://go.dev/play/p/y5g0tn_w4eZ

What did you expect to see?

Same output for both the parent and the cloned template.

What did you see instead?

The cloned template is using the default (invalid) option.

@simonhege simonhege mentioned this issue May 10, 2023
3 tasks
@seankhliao
Copy link
Member

Duplicate of #43022

@seankhliao seankhliao marked this as a duplicate of #43022 May 10, 2023
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2023
@golang golang locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants