-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Milestone
Description
package main
import (
"os"
"text/template"
)
type T struct {
D *string
}
func main() {
t, err := template.New("x").Parse("{{html .D}}")
if err != nil { panic(err) }
d := "hi\n"
err = t.Execute(os.Stdout, T{&d})
if err != nil { panic(err) }
}
One feels this should print "hi" but instead it prints the hex address of the
string. Ugly.
What should be done? Should functions autoindirect their args? Should template provide
an indirection operator? Tread carefully but fix.