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: remove Until? #18709

Closed
rsc opened this issue Jan 18, 2017 · 4 comments
Closed

time: remove Until? #18709

rsc opened this issue Jan 18, 2017 · 4 comments
Milestone

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Jan 18, 2017

Based on the direction #12914 is heading, it looks like nearly all uses of time.Now+time.Since should be using time.XXX and time.SinceYYY instead (XXX and YYY yet to be determined), to use a monotonic clock in place of the wall clock.

Go 1.8 introduces time.Until. Uses of time.Until are likely just as wrong as uses of time.Since. Should we remove time.Until from Go 1.8, at least until we know what we are doing with monotonic clocks?

@rsc rsc added this to the Go1.8 milestone Jan 18, 2017
@dsnet
Copy link
Member

@dsnet dsnet commented Jan 18, 2017

Removing Until doesn't change the fact Since is still relative to Now(). If we were change Until to be relative to the new monotonic API, I think it would be more confusing. I'm not oppose to removal, though.

@mvdan
Copy link
Member

@mvdan mvdan commented Jan 19, 2017

Since Until is just a commodity function, I agree that it shouldn't be added until we figure out what to do with monotonic clocks. Independently of whether Since is still broken or other factors, leaving this in would encourage the non-monotonic approach further and we wouldn't be able to change it later.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jan 19, 2017

I'm slightly in favor of keeping it. Like @dsnet says, Since already exists and we can't change it, which means we'll need some new names anyway, and it'd be weird if we add Until later but with time.XXX types.

@rsc
Copy link
Contributor Author

@rsc rsc commented Jan 19, 2017

I'm OK with keeping it too. Just wanted to get people talking. Let's worry about fixing real bugs instead.

@rsc rsc closed this Jan 19, 2017
@golang golang locked and limited conversation to collaborators Jan 19, 2018
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
5 participants
You can’t perform that action at this time.