Go version
1.23
Output of go env in your module/workspace:
What did you do?
I parse a time string using a known location name.
The resulting time ends up with the location name being empty, though.
location, err := time.LoadLocation("Europe/Helsinki")
if err != nil {
panic(err)
}
t, err := time.ParseInLocation(time.RFC3339, "2022-09-29T13:00:00+02:00", location)
if err != nil {
panic(err)
}
fmt.Printf("Expected: %s, Got: %s\n", location.String(), t.Location().String())
https://go.dev/play/p/WVdVLmBjkuL
What did you see happen?
The given example prints: Expected: Europe/Helsinki, Got:
What did you expect to see?
The given example prints: Expected: Europe/Helsinki, Got: Europe/Helsinki