Skip to content

Commit 88915cc

Browse files
committed
acme, acme/autocert: switch to Go 1.7+ context package
The standard library context package has been available since Go 1.7, and the Go build dashboard (build.golang.org) only tests master and the past two releases. Also, the acme package makes no backwards compatibility guarantees, not that I expect this to influence many people. Change-Id: Ia1a294212e1e531f28f53cd954d4743a64611cab Reviewed-on: https://go-review.googlesource.com/39272 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Alex Vaghin <ddos@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent b5cf4d8 commit 88915cc

File tree

8 files changed

+8
-12
lines changed

8 files changed

+8
-12
lines changed

acme/acme.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ package acme
1515

1616
import (
1717
"bytes"
18+
"context"
1819
"crypto"
1920
"crypto/ecdsa"
2021
"crypto/elliptic"
@@ -37,7 +38,6 @@ import (
3738
"sync"
3839
"time"
3940

40-
"golang.org/x/net/context"
4141
"golang.org/x/net/context/ctxhttp"
4242
)
4343

acme/acme_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package acme
66

77
import (
88
"bytes"
9+
"context"
910
"crypto/rand"
1011
"crypto/rsa"
1112
"crypto/tls"
@@ -23,8 +24,6 @@ import (
2324
"strings"
2425
"testing"
2526
"time"
26-
27-
"golang.org/x/net/context"
2827
)
2928

3029
// Decodes a JWS-encoded request and unmarshals the decoded JSON into a provided

acme/autocert/autocert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package autocert
1010

1111
import (
1212
"bytes"
13+
"context"
1314
"crypto"
1415
"crypto/ecdsa"
1516
"crypto/elliptic"
@@ -30,7 +31,6 @@ import (
3031
"time"
3132

3233
"golang.org/x/crypto/acme"
33-
"golang.org/x/net/context"
3434
)
3535

3636
// pseudoRand is safe for concurrent use.

acme/autocert/autocert_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package autocert
66

77
import (
8+
"context"
89
"crypto"
910
"crypto/ecdsa"
1011
"crypto/elliptic"
@@ -27,7 +28,6 @@ import (
2728
"time"
2829

2930
"golang.org/x/crypto/acme"
30-
"golang.org/x/net/context"
3131
)
3232

3333
var discoTmpl = template.Must(template.New("disco").Parse(`{

acme/autocert/cache.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
package autocert
66

77
import (
8+
"context"
89
"errors"
910
"io/ioutil"
1011
"os"
1112
"path/filepath"
12-
13-
"golang.org/x/net/context"
1413
)
1514

1615
// ErrCacheMiss is returned when a certificate is not found in cache.

acme/autocert/cache_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
package autocert
66

77
import (
8+
"context"
89
"io/ioutil"
910
"os"
1011
"path/filepath"
1112
"reflect"
1213
"testing"
13-
14-
"golang.org/x/net/context"
1514
)
1615

1716
// make sure DirCache satisfies Cache interface

acme/autocert/renewal.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
package autocert
66

77
import (
8+
"context"
89
"crypto"
910
"sync"
1011
"time"
11-
12-
"golang.org/x/net/context"
1312
)
1413

1514
// maxRandRenew is a maximum deviation from Manager.RenewBefore.

acme/autocert/renewal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package autocert
66

77
import (
8+
"context"
89
"crypto/ecdsa"
910
"crypto/elliptic"
1011
"crypto/rand"
@@ -18,7 +19,6 @@ import (
1819
"time"
1920

2021
"golang.org/x/crypto/acme"
21-
"golang.org/x/net/context"
2222
)
2323

2424
func TestRenewalNext(t *testing.T) {

0 commit comments

Comments
 (0)