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
This seems to be syntactically right but the way it's interpreted is not what I expected
{{ template "pwet" . | stringToGzipedBase64 }} // What I wrote
{{ template "pwet" (. | stringToGzipedBase64) }} // How it's interpreted by the parser
{{ (template "pwet" .) | stringToGzipedBase64 }} // How I think it should be interpreted
The text was updated successfully, but these errors were encountered:
{{template "name"}}
The template with the specified name is executed with nil data.
{{template "name" pipeline}}
The template with the specified name is executed with dot set
to the value of the pipeline.
This means that {{template "pwet" . | stringToGzipedBase64}} is indeed interpreted as {{ template "pwet" (. | stringToGzipedBase64) }}, because the template key word cannot send it's output to a pipeline, only take it's input from one.
So the behavior we are seeing is as specified. Unfortunately, what you are trying to do, that is, capture the result of a template statement is not supported yet. Maybe it should be, but for the moment your example is working as expected.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
https://play.golang.org/p/zPTLk2G-iAP
I'd like to gzip and base64 the output of the template so I've written this:
This seems to be syntactically right but the way it's interpreted is not what I expected
The text was updated successfully, but these errors were encountered: