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
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
What did you do?
package main
import (
"os"
"text/template"
)
func main() {
// Define a template.
const tmpl = this is a test {{.list[1]}}
// Prepare some data to insert into the template.
var UserList = []string{
"aaaaa",
"bbbbb",
"ccccc",
"ddddd",
}
td := map[string]interface{}{
"name": "test",
"list": UserList,
}
// Create a new template and parse the letter into it.
t := template.Must(template.New("tmpl").Parse(tmpl))
t.Execute(os.Stdout, td)
}
What did you expect to see?
i want : " this is a test bbbbb"
What did you see instead?
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
package main
import (
"os"
"text/template"
)
func main() {
// Define a template.
const tmpl =
this is a test {{.list[1]}}
}
What did you expect to see?
i want : " this is a test bbbbb"
What did you see instead?
The text was updated successfully, but these errors were encountered: