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
Why not define this layout as a standard const value? #42012
Comments
Read the docs:
The Go project doesn't use the issue tracker for questions. See https://golang.org/wiki/Questions. |
@mvdan I think it's inappropriate because json.Marshal and many other methods use this function for time.Time to convert a string. So I demand to define this layout as a const valiable. Also, this annotation here is not that good. |
That doesn't seem to be true: https://golang.org/src/time/time.go?s=38148:38191#L1230 Again, I would suggest that you use the forums for these questions before filing bugs.
That comes off a bit aggressive, but I assume you didn't mean it that way. |
No,I mean strongly suggest,not that way.The json.marshal may be not a correct example,I mean we use time.Time.String very frequently,so make this layout as a constant may be very pretty or make the string function use time.RFC3339Nano layout would also be better(the second way may be not compatible),otherwise we should define the same layout ourself and it's duplicated. |
go/src/time/format.go
Line 451 in af87480
The text was updated successfully, but these errors were encountered: