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

proposal: text/template: Template block function that receives what is inside the block as input #44144

Closed
lucasew opened this issue Feb 7, 2021 · 1 comment

Comments

@lucasew
Copy link

lucasew commented Feb 7, 2021

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

$ go version
go version go1.15.7 linux/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
NixOS flake github:lucasew/nixcfg/a3c60d9cc069a7274f17b1a8b95b323d14bfaa14#acer-nix
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/lucasew/.cache/go-build"
GOENV="/home/lucasew/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/lucasew/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/lucasew/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/nix/store/zymy4dammwvlw8v01h23iycx6v8sdp9m-go-1.15.7/share/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/nix/store/zymy4dammwvlw8v01h23iycx6v8sdp9m-go-1.15.7/share/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/run/user/1000/go-build733009741=/tmp/go-build -gno-record-gcc-swi
tches"

What did you do?

https://play.golang.org/p/SYFeODZTB4G

What did you expect to see?

*Sample text*

What did you see instead?

panic: template: test:2: function "blockapply" not defined

goroutine 1 [running]:
text/template.Must(...)
	/usr/local/go-faketime/src/text/template/helper.go:23
main.main()
	/tmp/sandbox276814028/prog.go:16 +0x28b

Program exited: status 2.
@gopherbot gopherbot added this to the Proposal milestone Feb 7, 2021
@lucasew lucasew changed the title proposal: Template block function that receives what is inside the block as input proposal: text/template: Template block function that receives what is inside the block as input Feb 7, 2021
@seankhliao
Copy link
Member

previously proposed (and declined) as #33273

@golang golang locked and limited conversation to collaborators Feb 7, 2022
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