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
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.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: