Skip to content

Commit a1ae214

Browse files
authored
remove golang.org/x/net dependency (#295)
* remove golang.org/x/net dependency The golang.org/x/net/context package is an alias for stdlib context since go1.7 (see https://go-review.googlesource.com/72570) This patch replaces all uses of it for stdlib context. Signed-off-by: Sebastiaan van Stijn <[email protected]> * rename App Engine context type to remove import aliases Signed-off-by: Sebastiaan van Stijn <[email protected]> --------- Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 504804f commit a1ae214

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+248
-284
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ code importing `appengine/datastore` will now need to import `google.golang.org/
5151
Most App Engine services are available with exactly the same API.
5252
A few APIs were cleaned up, and there are some differences:
5353

54-
* `appengine.Context` has been replaced with the `Context` type from `golang.org/x/net/context`.
54+
* `appengine.Context` has been replaced with the `Context` type from `context`.
5555
* Logging methods that were on `appengine.Context` are now functions in `google.golang.org/appengine/log`.
5656
* `appengine.Timeout` has been removed. Use `context.WithTimeout` instead.
5757
* `appengine.Datacenter` now takes a `context.Context` argument.

aetest/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package aetest
22

33
import (
4+
"context"
45
"io"
56
"net/http"
67
"time"
78

8-
"golang.org/x/net/context"
99
"google.golang.org/appengine"
1010
)
1111

appengine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
package appengine // import "google.golang.org/appengine"
1010

1111
import (
12+
"context"
1213
"net/http"
1314

1415
"github.com/golang/protobuf/proto"
15-
"golang.org/x/net/context"
1616

1717
"google.golang.org/appengine/internal"
1818
)

blobstore/blobstore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package blobstore // import "google.golang.org/appengine/blobstore"
99
import (
1010
"bufio"
1111
"bytes"
12+
"context"
1213
"encoding/base64"
1314
"fmt"
1415
"io"
@@ -23,7 +24,6 @@ import (
2324
"time"
2425

2526
"github.com/golang/protobuf/proto"
26-
"golang.org/x/net/context"
2727
"golang.org/x/text/encoding/htmlindex"
2828

2929
"google.golang.org/appengine"

blobstore/read.go

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

77
import (
8+
"context"
89
"errors"
910
"fmt"
1011
"io"
1112
"os"
1213
"sync"
1314

1415
"github.com/golang/protobuf/proto"
15-
"golang.org/x/net/context"
1616

1717
"google.golang.org/appengine"
1818
"google.golang.org/appengine/internal"

capability/capability.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Example:
1717
package capability // import "google.golang.org/appengine/capability"
1818

1919
import (
20-
"golang.org/x/net/context"
20+
"context"
2121

2222
"google.golang.org/appengine/internal"
2323
"google.golang.org/appengine/log"

channel/channel.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ https://cloud.google.com/appengine/docs/deprecations/channel
2525
package channel // import "google.golang.org/appengine/channel"
2626

2727
import (
28+
"context"
2829
"encoding/json"
2930

30-
"golang.org/x/net/context"
31-
3231
"google.golang.org/appengine"
3332
"google.golang.org/appengine/internal"
3433
basepb "google.golang.org/appengine/internal/base"

cmd/aefix/ae.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
ctxPackage = "golang.org/x/net/context"
15+
ctxPackage = "context"
1616

1717
newPackageBase = "google.golang.org/"
1818
stutterPackage = false

cmd/aefix/ae_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ func f(w http.ResponseWriter, r *http.Request) {
3838
Out: `package foo
3939
4040
import (
41+
"context"
4142
"net/http"
4243
"time"
4344
44-
"golang.org/x/net/context"
4545
"google.golang.org/appengine"
4646
"google.golang.org/appengine/datastore"
4747
"google.golang.org/appengine/log"
@@ -74,7 +74,7 @@ func LogSomething(c2 appengine.Context) {
7474
Out: `package foo
7575
7676
import (
77-
"golang.org/x/net/context"
77+
"context"
7878
"google.golang.org/appengine/log"
7979
)
8080
@@ -102,7 +102,7 @@ func f(ctx appengine.Context) {
102102
Out: `package foo
103103
104104
import (
105-
"golang.org/x/net/context"
105+
"context"
106106
"google.golang.org/appengine/taskqueue"
107107
)
108108
@@ -131,7 +131,7 @@ func f(ctx appengine.Context, w io.Writer) {
131131
Out: `package foo
132132
133133
import (
134-
"golang.org/x/net/context"
134+
"context"
135135
"google.golang.org/appengine"
136136
"io"
137137
)

datastore/datastore.go

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

77
import (
8+
"context"
89
"errors"
910
"fmt"
1011
"reflect"
1112

1213
"github.com/golang/protobuf/proto"
13-
"golang.org/x/net/context"
1414

1515
"google.golang.org/appengine"
1616
"google.golang.org/appengine/internal"

0 commit comments

Comments
 (0)