Run of fresh-snapshots for golang-golang-x-time

Try this locally (using silver-platter):

debian-svp new-upstream --snapshot golang-golang-x-time 

Merge these changes:

Summary

Merged new upstream version: 0.0~git20190308.0.9d24e82 (was: 0.0~git20161028.0.f51c127).

Diff

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 88dff59..d0485e8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,16 +4,15 @@ Go is an open source project.
 
 It is the work of hundreds of contributors. We appreciate your help!
 
-
 ## Filing issues
 
 When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:
 
-1. What version of Go are you using (`go version`)?
-2. What operating system and processor architecture are you using?
-3. What did you do?
-4. What did you expect to see?
-5. What did you see instead?
+1.  What version of Go are you using (`go version`)?
+2.  What operating system and processor architecture are you using?
+3.  What did you do?
+4.  What did you expect to see?
+5.  What did you see instead?
 
 General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
 The gophers there will answer or ask you to file an issue if you've tripped over a bug.
@@ -23,9 +22,5 @@ The gophers there will answer or ask you to file an issue if you've tripped over
 Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
 before sending patches.
 
-**We do not accept GitHub pull requests**
-(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).
-
 Unless otherwise noted, the Go source files are distributed under
 the BSD-style license found in the LICENSE file.
-
diff --git a/README b/README
deleted file mode 100644
index 144e347..0000000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-This repository provides supplementary Go time packages.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ce9becd
--- /dev/null
+++ b/README.md
@@ -0,0 +1,17 @@
+# Go Time
+
+This repository provides supplementary Go time packages.
+
+## Download/Install
+
+The easiest way to install is to run `go get -u golang.org/x/time`. You can
+also manually git clone the repository to `$GOPATH/src/golang.org/x/time`.
+
+## Report Issues / Send Patches
+
+This repository uses Gerrit for code changes. To learn how to submit changes to
+this repository, see https://golang.org/doc/contribute.html.
+
+The main issue tracker for the time repository is located at
+https://github.com/golang/go/issues. Prefix your issue with "x/time:" in the
+subject line, so it is easy to find.
diff --git a/debian/changelog b/debian/changelog
index d843cf3..d4e05ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-golang-golang-x-time (0.0~git20161028.0.f51c127-3) UNRELEASED; urgency=medium
+golang-golang-x-time (0.0~git20190308.0.9d24e82-1) UNRELEASED; urgency=medium
 
   [ Alexandre Viau ]
   * Point Vcs-* urls to salsa.debian.org.
@@ -7,7 +7,10 @@ golang-golang-x-time (0.0~git20161028.0.f51c127-3) UNRELEASED; urgency=medium
   * Automated cme fixes.
   * Bump debhelper compat level to 11.
 
- -- Alexandre Viau <aviau@debian.org>  Mon, 02 Apr 2018 21:37:22 -0400
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sat, 17 Aug 2019 20:51:25 +0000
 
 golang-golang-x-time (0.0~git20161028.0.f51c127-2) unstable; urgency=medium
 
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..46ac917
--- /dev/null
+++ b/go.mod
@@ -0,0 +1 @@
+module golang.org/x/time
diff --git a/rate/rate.go b/rate/rate.go
index 938feaf..ae93e24 100644
--- a/rate/rate.go
+++ b/rate/rate.go
@@ -6,12 +6,11 @@
 package rate
 
 import (
+	"context"
 	"fmt"
 	"math"
 	"sync"
 	"time"
-
-	"golang.org/x/net/context"
 )
 
 // Limit defines the maximum frequency of some events.
@@ -244,8 +243,12 @@ func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) {
 	if !r.ok {
 		return fmt.Errorf("rate: Wait(n=%d) would exceed context deadline", n)
 	}
-	// Wait
-	t := time.NewTimer(r.DelayFrom(now))
+	// Wait if necessary
+	delay := r.DelayFrom(now)
+	if delay == 0 {
+		return nil
+	}
+	t := time.NewTimer(delay)
 	defer t.Stop()
 	select {
 	case <-t.C:
diff --git a/rate/rate_test.go b/rate/rate_test.go
index cf45d92..ec8c66d 100644
--- a/rate/rate_test.go
+++ b/rate/rate_test.go
@@ -2,17 +2,18 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build go1.7
+
 package rate
 
 import (
+	"context"
 	"math"
 	"runtime"
 	"sync"
 	"sync/atomic"
 	"testing"
 	"time"
-
-	"golang.org/x/net/context"
 )
 
 func TestLimit(t *testing.T) {
@@ -164,6 +165,9 @@ func TestSimultaneousRequests(t *testing.T) {
 }
 
 func TestLongRunningQPS(t *testing.T) {
+	if testing.Short() {
+		t.Skip("skipping in short mode")
+	}
 	if runtime.GOOS == "openbsd" {
 		t.Skip("low resolution time.Sleep invalidates test (golang.org/issue/14183)")
 		return
@@ -443,3 +447,13 @@ func BenchmarkAllowN(b *testing.B) {
 		}
 	})
 }
+
+func BenchmarkWaitNNoDelay(b *testing.B) {
+	lim := NewLimiter(Limit(b.N), b.N)
+	ctx := context.Background()
+	b.ReportAllocs()
+	b.ResetTimer()
+	for i := 0; i < b.N; i++ {
+		lim.WaitN(ctx, 1)
+	}
+}

Full worker log Full build log