-
Notifications
You must be signed in to change notification settings - Fork 18k
time: Format() ignores _ on go tip #23259
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
Comments
Git bisect points to 8776be1 |
That change (https://golang.org/cl/78735) changes the string Since the use of Any other opinions? CC @robpike @hallazzang |
I know breaking someone's existing code is not good, I just wanted to make consistent API as I said in #22802. Since the result of this code(https://play.golang.org/p/3fAVlR36KIf) also seems not proper for you(on go 1.9.2), I can't find the best solution for this problem. Here are what I can imagine as the second best solutions:
Except for the last suggestion, those two above should be in Go 2 milestone since there should be a guarantee that it'll not break the existing code in Go 1. And you can give a look at this code, which might be DEFINITELY not the one you were looking for: https://play.golang.org/p/3G7dNIPYdMo |
I think it might be best to roll back for 1.10 and approach with a longer lead-up in the next release, if at all. |
Ok, that looks fine too. |
It's not that obscure. This bit me today and had me debugging for quite some time till I realised this was a bug in master. I believe something like Failing code - https://github.com/agnivade/funnel/blob/master/rollup.go#L19 tt := time.Now().UTC()
t.Log(tt.Format("2006-01-02_15-04-05"))
t.Log(tt.Format("2006-01-02#15-04-05")) gives
The results are pretty drastically different. "_07" to " 127". I would recommend rollback. |
Change https://golang.org/cl/85998 mentions this issue: |
Thanks for reverting, for the record I was also affected by this (format string : |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Only on master.
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/1ccgLvVk8Jx
What did you expect to see?
20171227_122425
What did you see instead?
2017122712252425
(no _).More info
It works fine on Go 1.9.2 and Go 1.10beta1:
The text was updated successfully, but these errors were encountered: