Skip to content
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

time: don't print nil Location as "UTC" #11059

Closed
178inaba opened this issue Jun 4, 2015 · 3 comments
Closed

time: don't print nil Location as "UTC" #11059

178inaba opened this issue Jun 4, 2015 · 3 comments
Milestone

Comments

@178inaba
Copy link
Contributor

@178inaba 178inaba commented Jun 4, 2015

Hi there
The first time I'll post.

http://play.golang.org/p/TAyGLFfUUa

time.LoadLocation() If an invalid value is passed on, it is displayed in fmt.Println() "UTC".
However, actually nil so panic occurs when you use the Location.
This behavior is
https://github.com/golang/go/blob/master/src/time/zoneinfo.go#L73
Due to that it returns the UTC above.

I think this behavior had better fix.
Location I think is that we should be printed as if nil "".
Or, I think Location came back is good if it is available as UTC.
In that case,
https://github.com/golang/go/blob/master/src/time/zoneinfo_unix.go#L89
I think I should I return the UTC above.

I think this sentence because English is not good I wrote in the google translation.
I'm sorry if there is an unknown sentence.

Thank you for reading to the last.
golang love! Fun!

@178inaba
Copy link
Contributor Author

@178inaba 178inaba commented Jun 4, 2015

Oops
I was wrong.
So you have changed to an error such as the current master "can not find undef in zip file zoneinfo.zip".
https://github.com/golang/go/blob/master/src/time/zoneinfo_read.go#L342
It seems to return the Error at the location of the above-mentioned URL.

@ianlancetaylor ianlancetaylor changed the title behavior when an invalid value is passed to the time.LoadLocation() time: don't print nil Location as "UTC" Jun 4, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 4, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 2, 2015

CL https://golang.org/cl/14176 mentions this issue.

@rsc
Copy link
Contributor

@rsc rsc commented Oct 24, 2015

No thanks. See discussion on CL 14176.

@rsc rsc closed this Oct 24, 2015
@golang golang locked and limited conversation to collaborators Oct 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.