Skip to content

Commit 7d62e40

Browse files
committed
Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything that is provided by "x/net/context" is a couple of type aliases to types in "context". Many vendored packages still use x/net/context, so vendor entry remains for now. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 5c233cf commit 7d62e40

File tree

346 files changed

+369
-426
lines changed

Some content is hidden

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

346 files changed

+369
-426
lines changed

api/server/backend/build/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package build // import "github.com/docker/docker/api/server/backend/build"
22

33
import (
4+
"context"
45
"fmt"
56

67
"github.com/docker/distribution/reference"
@@ -11,7 +12,6 @@ import (
1112
"github.com/docker/docker/image"
1213
"github.com/docker/docker/pkg/stringid"
1314
"github.com/pkg/errors"
14-
"golang.org/x/net/context"
1515
)
1616

1717
// ImageComponent provides an interface for working with images

api/server/httputils/httputils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package httputils // import "github.com/docker/docker/api/server/httputils"
22

33
import (
4+
"context"
45
"io"
56
"mime"
67
"net/http"
@@ -9,7 +10,6 @@ import (
910
"github.com/docker/docker/errdefs"
1011
"github.com/pkg/errors"
1112
"github.com/sirupsen/logrus"
12-
"golang.org/x/net/context"
1313
)
1414

1515
type contextKey string

api/server/httputils/write_log_stream.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package httputils // import "github.com/docker/docker/api/server/httputils"
22

33
import (
4+
"context"
45
"fmt"
56
"io"
67
"net/url"
78
"sort"
89

9-
"golang.org/x/net/context"
10-
1110
"github.com/docker/docker/api/types"
1211
"github.com/docker/docker/api/types/backend"
1312
"github.com/docker/docker/pkg/ioutils"

api/server/middleware/cors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package middleware // import "github.com/docker/docker/api/server/middleware"
22

33
import (
4+
"context"
45
"net/http"
56

67
"github.com/sirupsen/logrus"
7-
"golang.org/x/net/context"
88
)
99

1010
// CORSMiddleware injects CORS headers to each request

api/server/middleware/debug.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package middleware // import "github.com/docker/docker/api/server/middleware"
22

33
import (
44
"bufio"
5+
"context"
56
"encoding/json"
67
"io"
78
"net/http"
@@ -10,7 +11,6 @@ import (
1011
"github.com/docker/docker/api/server/httputils"
1112
"github.com/docker/docker/pkg/ioutils"
1213
"github.com/sirupsen/logrus"
13-
"golang.org/x/net/context"
1414
)
1515

1616
// DebugRequestMiddleware dumps the request to logger

api/server/middleware/experimental.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package middleware // import "github.com/docker/docker/api/server/middleware"
22

33
import (
4+
"context"
45
"net/http"
5-
6-
"golang.org/x/net/context"
76
)
87

98
// ExperimentalMiddleware is a the middleware in charge of adding the

api/server/middleware/middleware.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package middleware // import "github.com/docker/docker/api/server/middleware"
22

33
import (
4+
"context"
45
"net/http"
5-
6-
"golang.org/x/net/context"
76
)
87

98
// Middleware is an interface to allow the use of ordinary functions as Docker API filters.

api/server/middleware/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package middleware // import "github.com/docker/docker/api/server/middleware"
22

33
import (
4+
"context"
45
"fmt"
56
"net/http"
67
"runtime"
78

89
"github.com/docker/docker/api/server/httputils"
910
"github.com/docker/docker/api/types/versions"
10-
"golang.org/x/net/context"
1111
)
1212

1313
// VersionMiddleware is a middleware that

api/server/middleware/version_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package middleware // import "github.com/docker/docker/api/server/middleware"
22

33
import (
4+
"context"
45
"net/http"
56
"net/http/httptest"
67
"runtime"
@@ -9,7 +10,6 @@ import (
910
"github.com/docker/docker/api/server/httputils"
1011
"github.com/gotestyourself/gotestyourself/assert"
1112
is "github.com/gotestyourself/gotestyourself/assert/cmp"
12-
"golang.org/x/net/context"
1313
)
1414

1515
func TestVersionMiddlewareVersion(t *testing.T) {

api/server/router/build/backend.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package build // import "github.com/docker/docker/api/server/router/build"
22

33
import (
4+
"context"
5+
46
"github.com/docker/docker/api/types"
57
"github.com/docker/docker/api/types/backend"
6-
"golang.org/x/net/context"
78
)
89

910
// Backend abstracts an image builder whose only purpose is to build an image referenced by an imageID.

api/server/router/build/build_routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package build // import "github.com/docker/docker/api/server/router/build"
22

33
import (
44
"bytes"
5+
"context"
56
"encoding/base64"
67
"encoding/json"
78
"fmt"
@@ -25,7 +26,6 @@ import (
2526
units "github.com/docker/go-units"
2627
"github.com/pkg/errors"
2728
"github.com/sirupsen/logrus"
28-
"golang.org/x/net/context"
2929
)
3030

3131
type invalidIsolationError string

api/server/router/checkpoint/checkpoint_routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package checkpoint // import "github.com/docker/docker/api/server/router/checkpoint"
22

33
import (
4+
"context"
45
"encoding/json"
56
"net/http"
67

78
"github.com/docker/docker/api/server/httputils"
89
"github.com/docker/docker/api/types"
9-
"golang.org/x/net/context"
1010
)
1111

1212
func (s *checkpointRouter) postContainerCheckpoint(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

api/server/router/container/backend.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package container // import "github.com/docker/docker/api/server/router/container"
22

33
import (
4+
"context"
45
"io"
56

6-
"golang.org/x/net/context"
7-
87
"github.com/docker/docker/api/types"
98
"github.com/docker/docker/api/types/backend"
109
"github.com/docker/docker/api/types/container"

api/server/router/container/container_routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package container // import "github.com/docker/docker/api/server/router/container"
22

33
import (
4+
"context"
45
"encoding/json"
56
"fmt"
67
"io"
@@ -20,7 +21,6 @@ import (
2021
"github.com/docker/docker/pkg/signal"
2122
"github.com/pkg/errors"
2223
"github.com/sirupsen/logrus"
23-
"golang.org/x/net/context"
2424
"golang.org/x/net/websocket"
2525
)
2626

api/server/router/container/copy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package container // import "github.com/docker/docker/api/server/router/containe
33
import (
44
"compress/flate"
55
"compress/gzip"
6+
"context"
67
"encoding/base64"
78
"encoding/json"
89
"io"
@@ -12,7 +13,6 @@ import (
1213
"github.com/docker/docker/api/types"
1314
"github.com/docker/docker/api/types/versions"
1415
gddohttputil "github.com/golang/gddo/httputil"
15-
"golang.org/x/net/context"
1616
)
1717

1818
type pathError struct{}

api/server/router/container/exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package container // import "github.com/docker/docker/api/server/router/container"
22

33
import (
4+
"context"
45
"encoding/json"
56
"fmt"
67
"io"
@@ -13,7 +14,6 @@ import (
1314
"github.com/docker/docker/errdefs"
1415
"github.com/docker/docker/pkg/stdcopy"
1516
"github.com/sirupsen/logrus"
16-
"golang.org/x/net/context"
1717
)
1818

1919
func (s *containerRouter) getExecByID(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

api/server/router/container/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package container // import "github.com/docker/docker/api/server/router/container"
22

33
import (
4+
"context"
45
"net/http"
56

67
"github.com/docker/docker/api/server/httputils"
7-
"golang.org/x/net/context"
88
)
99

1010
// getContainersByName inspects container's configuration and serializes it as json.

api/server/router/debug/debug.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package debug // import "github.com/docker/docker/api/server/router/debug"
22

33
import (
4+
"context"
45
"expvar"
56
"net/http"
67
"net/http/pprof"
78

89
"github.com/docker/docker/api/server/httputils"
910
"github.com/docker/docker/api/server/router"
10-
"golang.org/x/net/context"
1111
)
1212

1313
// NewRouter creates a new debug router

api/server/router/debug/debug_routes.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package debug // import "github.com/docker/docker/api/server/router/debug"
22

33
import (
4+
"context"
45
"net/http"
56
"net/http/pprof"
6-
7-
"golang.org/x/net/context"
87
)
98

109
func handlePprof(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

api/server/router/distribution/backend.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package distribution // import "github.com/docker/docker/api/server/router/distribution"
22

33
import (
4+
"context"
5+
46
"github.com/docker/distribution"
57
"github.com/docker/distribution/reference"
68
"github.com/docker/docker/api/types"
7-
"golang.org/x/net/context"
89
)
910

1011
// Backend is all the methods that need to be implemented

api/server/router/distribution/distribution_routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package distribution // import "github.com/docker/docker/api/server/router/distribution"
22

33
import (
4+
"context"
45
"encoding/base64"
56
"encoding/json"
67
"net/http"
@@ -15,7 +16,6 @@ import (
1516
registrytypes "github.com/docker/docker/api/types/registry"
1617
"github.com/opencontainers/image-spec/specs-go/v1"
1718
"github.com/pkg/errors"
18-
"golang.org/x/net/context"
1919
)
2020

2121
func (s *distributionRouter) getDistributionInfo(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

api/server/router/experimental.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package router // import "github.com/docker/docker/api/server/router"
22

33
import (
4+
"context"
45
"net/http"
56

6-
"golang.org/x/net/context"
7-
87
"github.com/docker/docker/api/server/httputils"
98
)
109

api/server/router/image/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package image // import "github.com/docker/docker/api/server/router/image"
22

33
import (
4+
"context"
45
"io"
56

67
"github.com/docker/docker/api/types"
78
"github.com/docker/docker/api/types/filters"
89
"github.com/docker/docker/api/types/image"
910
"github.com/docker/docker/api/types/registry"
10-
"golang.org/x/net/context"
1111
)
1212

1313
// Backend is all the methods that need to be implemented

api/server/router/image/image_routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package image // import "github.com/docker/docker/api/server/router/image"
22

33
import (
4+
"context"
45
"encoding/base64"
56
"encoding/json"
67
"fmt"
@@ -19,7 +20,6 @@ import (
1920
"github.com/docker/docker/registry"
2021
specs "github.com/opencontainers/image-spec/specs-go/v1"
2122
"github.com/pkg/errors"
22-
"golang.org/x/net/context"
2323
)
2424

2525
// Creates an image from Pull or from Import

api/server/router/local.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package router // import "github.com/docker/docker/api/server/router"
22

33
import (
4+
"context"
45
"net/http"
56

67
"github.com/docker/docker/api/server/httputils"
7-
"golang.org/x/net/context"
88
)
99

1010
// RouteWrapper wraps a route with extra functionality.

api/server/router/network/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package network // import "github.com/docker/docker/api/server/router/network"
22

33
import (
4-
"golang.org/x/net/context"
4+
"context"
55

66
"github.com/docker/docker/api/types"
77
"github.com/docker/docker/api/types/filters"

api/server/router/network/network_routes.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package network // import "github.com/docker/docker/api/server/router/network"
22

33
import (
4+
"context"
45
"encoding/json"
56
"net/http"
67
"strconv"
78
"strings"
89

9-
"golang.org/x/net/context"
10-
1110
"github.com/docker/docker/api/server/httputils"
1211
"github.com/docker/docker/api/types"
1312
"github.com/docker/docker/api/types/filters"

api/server/router/plugin/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package plugin // import "github.com/docker/docker/api/server/router/plugin"
22

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

78
"github.com/docker/distribution/reference"
89
enginetypes "github.com/docker/docker/api/types"
910
"github.com/docker/docker/api/types/filters"
1011
"github.com/docker/docker/plugin"
11-
"golang.org/x/net/context"
1212
)
1313

1414
// Backend for Plugin

0 commit comments

Comments
 (0)