Replace "golang.org/x/net/context" with "context" for go1.7+ #2154

This commit is contained in:
Nick Craig-Wood 2018-04-06 19:13:27 +01:00
parent 67023f0040
commit 80588a5a6b
16 changed files with 19 additions and 21 deletions

View File

@ -3,18 +3,17 @@
package cache
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"path"
"path/filepath"
"strings"
"sync"
"time"
"os"
"os/signal"
"syscall"
"time"
"github.com/ncw/rclone/backend/crypt"
"github.com/ncw/rclone/fs"
@ -26,7 +25,6 @@ import (
"github.com/ncw/rclone/fs/walk"
"github.com/ncw/rclone/lib/atexit"
"github.com/pkg/errors"
"golang.org/x/net/context"
"golang.org/x/time/rate"
)

View File

@ -5,6 +5,7 @@
package sftp
import (
"context"
"fmt"
"io"
"io/ioutil"
@ -27,7 +28,6 @@ import (
"github.com/pkg/sftp"
"github.com/xanzy/ssh-agent"
"golang.org/x/crypto/ssh"
"golang.org/x/net/context"
"golang.org/x/time/rate"
)

View File

@ -12,7 +12,7 @@ import (
"github.com/ncw/rclone/fs/log"
"github.com/ncw/rclone/vfs"
"github.com/pkg/errors"
"golang.org/x/net/context"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.8
)
// Dir represents a directory entry

View File

@ -10,7 +10,7 @@ import (
"github.com/ncw/rclone/cmd/mountlib"
"github.com/ncw/rclone/fs/log"
"github.com/ncw/rclone/vfs"
"golang.org/x/net/context"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.8
)
// File represents a file

View File

@ -14,7 +14,7 @@ import (
"github.com/ncw/rclone/vfs"
"github.com/ncw/rclone/vfs/vfsflags"
"github.com/pkg/errors"
"golang.org/x/net/context"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.8
)
// FS represents the top level filing system

View File

@ -9,7 +9,7 @@ import (
fusefs "bazil.org/fuse/fs"
"github.com/ncw/rclone/fs/log"
"github.com/ncw/rclone/vfs"
"golang.org/x/net/context"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.8
)
// FileHandle is an open for read file handle on a File

View File

@ -15,7 +15,7 @@ import (
"github.com/ncw/rclone/vfs"
"github.com/ncw/rclone/vfs/vfsflags"
"github.com/spf13/cobra"
"golang.org/x/net/context"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.8
"golang.org/x/net/webdav"
)

View File

@ -1,13 +1,13 @@
package accounting
import (
"context"
"sync"
"time"
"github.com/ncw/rclone/fs"
"github.com/ncw/rclone/fs/rc"
"github.com/pkg/errors"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.6
"golang.org/x/time/rate"
)

View File

@ -3,6 +3,7 @@ package fshttp
import (
"bytes"
"context"
"crypto/tls"
"net"
"net/http"
@ -12,7 +13,6 @@ import (
"time"
"github.com/ncw/rclone/fs"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.6
"golang.org/x/time/rate"
)

View File

@ -2,6 +2,7 @@
package march
import (
"context"
"path"
"sort"
"strings"
@ -11,7 +12,6 @@ import (
"github.com/ncw/rclone/fs/filter"
"github.com/ncw/rclone/fs/list"
"github.com/ncw/rclone/fs/walk"
"golang.org/x/net/context"
"golang.org/x/text/unicode/norm"
)

View File

@ -3,6 +3,7 @@ package operations
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
@ -26,7 +27,6 @@ import (
"github.com/ncw/rclone/lib/readers"
"github.com/pkg/errors"
"github.com/spf13/pflag"
"golang.org/x/net/context"
)
// CheckHashes checks the two files to see if they have common

View File

@ -2,6 +2,7 @@
package sync
import (
"context"
"fmt"
"sort"
"sync"
@ -14,7 +15,6 @@ import (
"github.com/ncw/rclone/fs/march"
"github.com/ncw/rclone/fs/operations"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
type syncCopyMove struct {

View File

@ -1,6 +1,7 @@
package oauthutil
import (
"context"
"crypto/rand"
"encoding/json"
"fmt"
@ -16,7 +17,6 @@ import (
"github.com/ncw/rclone/fs/fshttp"
"github.com/pkg/errors"
"github.com/skratchdot/open-golang/open"
"golang.org/x/net/context"
"golang.org/x/oauth2"
)

View File

@ -3,6 +3,7 @@
package vfs
import (
"context"
"fmt"
"os"
"path"
@ -17,7 +18,6 @@ import (
"github.com/ncw/rclone/fs"
"github.com/ncw/rclone/fs/config"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
// CacheMode controls the functionality of the cache

View File

@ -1,6 +1,7 @@
package vfs
import (
"context"
"fmt"
"io/ioutil"
"os"
@ -14,7 +15,6 @@ import (
"github.com/spf13/pflag"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.6
)
// Check CacheMode it satisfies the pflag interface

View File

@ -19,6 +19,7 @@
package vfs
import (
"context"
"fmt"
"os"
"path"
@ -28,7 +29,6 @@ import (
"github.com/ncw/rclone/fs"
"github.com/ncw/rclone/fs/log"
"golang.org/x/net/context" // switch to "context" when we stop supporting go1.6
)
// DefaultOpt is the default values uses for Opt