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: can add io.Writer as default argument with name is '&' in the empty? #16558

Closed
runner-mei opened this issue Aug 1, 2016 · 2 comments

Comments

@runner-mei
Copy link

@runner-mei runner-mei commented Aug 1, 2016

  1. What version of Go are you using (go version)?
    go version go1.7rc3 windows/amd64
  2. What operating system and processor architecture are you using (go env)?
    set GOARCH=amd64
    set GOBIN=
    set GOEXE=.exe
    set GOHOSTARCH=amd64
    set GOHOSTOS=windows
    set GOOS=windows
    set GOPATH=d:\developing\go\meijing..\3td;d:\developing\go\meijing
    set GORACE=
    set GOROOT=d:\tools\go_amd64
    set GOTOOLDIR=d:\tools\go_amd64\pkg\tool\windows_amd64
    set CC=gcc
    set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\meifakun\AppData\Local\Temp\go-build810938422=/tmp/go-build -gno-record-gcc-switches
    set CXX=g++
    set CGO_ENABLED=1
  3. What did you do?
    Take the simple example from
    https://play.golang.org/p/KMgTlxbI_s
  4. What did you expect to see?
    aaaa
@quentinmit
Copy link
Contributor

@quentinmit quentinmit commented Aug 1, 2016

You are ignoring the error return from template.New. If you actually look at the error, you'll see:

https://play.golang.org/p/NJcVvM9pzL
template: root:1: unexpected "&" in operand

"&" is not a valid expression in the template. AFAICT this is working as intended.

@quentinmit quentinmit closed this Aug 1, 2016
@runner-mei
Copy link
Author

@runner-mei runner-mei commented Aug 7, 2016

replace & with $output ?

@golang golang locked and limited conversation to collaborators Aug 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.