Skip to content

text/template: go1.18: erroneous evaluation of nil pointer #56769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
twmb opened this issue Nov 16, 2022 · 1 comment
Closed

text/template: go1.18: erroneous evaluation of nil pointer #56769

twmb opened this issue Nov 16, 2022 · 1 comment

Comments

@twmb
Copy link
Contributor

twmb commented Nov 16, 2022

I'm opening this issue for awareness and to see if this is worthy of a back-port fix. My worry is that this was fixed accidentally somehow in some refactoring and that this issue may manifest again in the future in another change / refactoring. Since this issue does not manifest in the latest version, it may be worth just closing this issue.

What version of Go are you using (go version)?

1.18 errors,
1.19 does not.

Does this issue reproduce with the latest release?

No.

What did you do?

https://go.dev/play/p/xp70kdF4urk?v=goprev

Switching to 1.19, the program exits with no error / no output. The condition can be switched to {{ if .Inner }} and it works in both versions.

What did you expect to see?

No error / no output.

What did you see instead?

template: x:3:11: executing "x" at <.Inner.Field>: nil pointer evaluating *struct { Field string }.Field
@seankhliao
Copy link
Member

Backports are only for serious issues with no known workaround (or security issues).
Given that this has a clear and easy fix, this doesn't appear to qualify.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2022
@golang golang locked and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants