Code review - Issue 7278049: code review 7278049: time: add Location.Parsehttps://codereview.appspot.com/2013-02-04T04:57:25+00:00rietveld
Message from unknown
2013-02-03T21:58:02+00:00bradfitzurn:md5:6e9555955ba4c3979133451a2d84d1f8
Message from unknown
2013-02-03T21:58:06+00:00bradfitzurn:md5:472959371d9748c50dad92346ca69a0a
Message from unknown
2013-02-03T21:58:11+00:00bradfitzurn:md5:ad3e96bc9d970e2d36b5a37c51c53e0a
Message from bradfitz@golang.org
2013-02-03T21:58:16+00:00bradfitzurn:md5:08053192e7a1d4e868a6cc6da5a67083
Hello golang-dev@googlegroups.com,
I'd like you to review this change to
https://go.googlecode.com/hg/
Message from unknown
2013-02-03T21:59:15+00:00bradfitzurn:md5:c705bbe61c28af5ec767eacd54d30acc
Message from rsc@golang.org
2013-02-04T00:37:10+00:00rscurn:md5:5b9570e3a953496fd82fbf45ee5c7064
Can it be func ParseInLocation instead? Location is required for using the
time package, but Parse is not. If we make Parse a method on Location it
becomes impossible to compile a binary without this code linked in.
Russ
Message from rsc@golang.org
2013-02-04T00:45:59+00:00rscurn:md5:963b1ee637215d14c8be97e88cd44688
Actually, I think the differences are a little more subtle. I'll include
the function in another time CL I am preparing.
Message from adg@golang.org
2013-02-04T00:58:26+00:00adgurn:md5:4ba03590bb55e41005756dd4c8cdde29
On 4 February 2013 11:37, Russ Cox <rsc@golang.org> wrote:
> Can it be func ParseInLocation instead? Location is required for using the
> time package, but Parse is not. If we make Parse a method on Location it
> becomes impossible to compile a binary without this code linked in.
I might be being dense, but I don't understand this at all.
Parse or ParseInLocation each return a time.Time, so the code needs to be
linked in regardless. Or do you mean that time.Location and its methods
must be linked in?
Message from rsc@golang.org
2013-02-04T01:06:48+00:00rscurn:md5:88d2e04a27fcc0381dd3d2cd2063e3ce
I mean that if you have a time.Time in your program, then by necessity you
have the code for time.Location, because time.Time's Location method
returns a time.Location. If we make Parse a method on Location, then it
becomes impossible to have a time.Time in your program without also linking
in the Parse code. Right now you only have the Parse code in your program
if you explicitly ask for it. It is a tiny thing, but it seems worth
preserving. Also, it turns out that time.Parse and time.ParseInLocation
have slightly different semantics, so even if we did put a Parse method on
Location, time.Parse != time.Local.Parse. I'd rather use a different name
for something with different semantics.
Russ
Message from adg@golang.org
2013-02-04T01:11:48+00:00adgurn:md5:15433aca22cdc52131df413aca201855
On 4 February 2013 12:06, Russ Cox <rsc@golang.org> wrote:
> If we make Parse a method on Location, then it becomes impossible to have
> a time.Time in your program without also linking in the Parse code.
Ah, I see. Thanks.
Message from bradfitz@golang.org
2013-02-04T04:57:25+00:00bradfitzurn:md5:b0c67df16e66159a622afc57efddb548
*** Abandoned ***