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
There's a program in production for 5 years on 2 servers. There has been no update to the code and no update to the server.
Prior to 2024, an {{if .XYZ}} where XYZ is a zero value time.Time would return false. Since 2024, all if in templates are entering the true condition and not the else.
Go version
go version go1.21.4 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
There's a program in production for 5 years on 2 servers. There has been no update to the code and no update to the server.
Prior to 2024, an
{{if .XYZ}}
whereXYZ
is a zero valuetime.Time
would return false. Since 2024, all if in templates are entering the true condition and not the else.Here's how to reproduce: https://go.dev/play/p/EnZo6Wicr8y
What did you expect to see?
Zero value
time.Time
were entering the{{else}}
branch before 2024.What did you see instead?
Now, a zero value
time.Time
enters the true branch of{{if}}
The text was updated successfully, but these errors were encountered: