Switch from x/net/context to context
Since Go 1.7, context is a standard package, superceding the
"x/net/context". Since Go 1.9, the latter only provides a few type
aliases from the former. Therefore, it makes sense to switch to the
standard package.
This commit was generated by the following script (with a couple of
minor fixups to remove extra changes done by goimports):
	#!/bin/bash
	if [ $# -ge 1 ]; then
		FILES=$*
	else
		FILES=$(git ls-files \*.go | grep -vF ".pb.go" | grep -v
	^vendor/)
	fi
	for f in $FILES; do
		printf .
		sed -i -e 's|"golang.org/x/net/context"$|"context"|' $f
		goimports -w $f
		awk '	/^$/ {e=1; next;}
			/[[:space:]]"context"$/ {e=0;}
			{if (e) {print ""; e=0}; print;}' < $f > $f.new && \
				mv $f.new $f
		goimports -w $f
	done
	echo
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
			
			
This commit is contained in:
		| @@ -17,6 +17,8 @@ | ||||
| package leases | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
|  | ||||
| 	"google.golang.org/grpc" | ||||
|  | ||||
| 	api "github.com/containerd/containerd/api/services/leases/v1" | ||||
| @@ -24,7 +26,6 @@ import ( | ||||
| 	"github.com/containerd/containerd/services" | ||||
| 	ptypes "github.com/gogo/protobuf/types" | ||||
| 	"github.com/pkg/errors" | ||||
| 	"golang.org/x/net/context" | ||||
| ) | ||||
|  | ||||
| func init() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kir Kolyshkin
					Kir Kolyshkin