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
After the reflect shuffling, text/template rejects .foo.Bar where foo is an unexported embedded field holding Bar. It probably should allow it (since reflect does too) but still reject plain .foo.
This is simplified from a real test failure.
$ cat x.go
package main
import (
"html/template"
"log"
"os"
)
func main() {
type foo struct {
Bar int
}
type X struct {
foo
}
t := template.Must(template.New("").Parse("{{.foo.Bar}}\n"))
err := t.Execute(os.Stdout, new(X))
if err != nil {
log.Fatal(err)
}
}
$ go1.5 run x.go
0
$ go run x.go
2016/01/08 15:55:14 template: :1:6: executing "" at <.foo.Bar>: foo is an unexported field of struct type *main.X
exit status 1
$
The text was updated successfully, but these errors were encountered:
On the other hand, {{.Bar}} works in both releases so maybe people should have to say that instead. Thinking. Will try to find the test failure again. I've misplaced it.
After the reflect shuffling, text/template rejects
.foo.Bar
wherefoo
is an unexported embedded field holdingBar
. It probably should allow it (since reflect does too) but still reject plain.foo
.This is simplified from a real test failure.
The text was updated successfully, but these errors were encountered: