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:
@@ -19,12 +19,11 @@
|
||||
package shim
|
||||
|
||||
import (
|
||||
gocontext "context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
|
||||
gocontext "context"
|
||||
|
||||
"github.com/containerd/console"
|
||||
"github.com/containerd/containerd/cmd/ctr/commands"
|
||||
shim "github.com/containerd/containerd/linux/shim/v1"
|
||||
|
Reference in New Issue
Block a user