-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version)?
go1.6
- What operating system and processor architecture are you using (
go env)?
Playground, also reproduced on
GOHOSTARCH="amd64"
GOHOSTOS="linux"
- What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
http://play.golang.org/p/fjDUgnco1F
- What did you expect to see?
A type has definite members. If a member is being requested that does not exist for that type the template should return a no type found error, even if the value of the type is nil.
- What did you see instead?
Executing a template with a typo on a nil struct gives the misleading error that the struct is nil. This is true but the real error is that no member can be found.
template: tmpl:1:2: executing "tmpl" at <.Get>: nil pointer evaluating *main.outer.Get
template: tmpl:1:2: executing "tmpl" at <.Get>: Get is not a field of struct type struct {}