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

tstime: add Since method #8622

Merged
merged 1 commit into from
Jul 14, 2023
Merged

tstime: add Since method #8622

merged 1 commit into from
Jul 14, 2023

Conversation

clairew
Copy link
Contributor

@clairew clairew commented Jul 14, 2023

Updates #8463

@clairew clairew requested a review from sailorfrag July 14, 2023 19:23
@clairew clairew force-pushed the clairew/tstime-since branch 2 times, most recently from 1e3cd0d to 43acf6f Compare July 14, 2023 19:56
tstest/clock_test.go Outdated Show resolved Hide resolved
tstest/clock_test.go Outdated Show resolved Hide resolved
tstest/clock_test.go Outdated Show resolved Hide resolved
tstest/clock.go Outdated Show resolved Hide resolved
Updates #8463

Signed-off-by: Claire Wang <claire@tailscale.com>
@clairew clairew force-pushed the clairew/tstime-since branch from 43acf6f to 28a72c5 Compare July 14, 2023 20:18
@clairew clairew merged commit 0573f6e into main Jul 14, 2023
@clairew clairew deleted the clairew/tstime-since branch July 14, 2023 20:50
@@ -303,6 +303,11 @@ func (c *Clock) AfterFunc(d time.Duration, f func()) tstime.TimerController {
return t
}

// Since subtracts specified duration from Now().
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no duration specified here.

How about we copy the docs from the standard library, which says:

Since returns the time elapsed since t. It is shorthand for time.Now().Sub(t).

alexelisenko pushed a commit to Control-D-Inc/tailscale that referenced this pull request Feb 15, 2024
Updates tailscale#8463

Signed-off-by: Claire Wang <claire@tailscale.com>
Signed-off-by: Alex Paguis <alex@windscribe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants