Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
text/template: misleading error in template: "nil pointer" on typo #15125
Please answer these questions before submitting your issue. Thanks!
Playground, also reproduced on
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.
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