Run goimports

This commit is contained in:
Alexander Neumann 2017-07-23 14:21:03 +02:00
parent 83d1a46526
commit 6caeff2408
158 changed files with 524 additions and 438 deletions

View File

@ -4,7 +4,7 @@ import (
"syscall" "syscall"
"unsafe" "unsafe"
"restic/debug" "github.com/restic/restic/internal/debug"
) )
// IsProcessBackground returns true if it is running in the background or false if not // IsProcessBackground returns true if it is running in the background or false if not

View File

@ -7,7 +7,7 @@ import (
"sync" "sync"
"syscall" "syscall"
"restic/debug" "github.com/restic/restic/internal/debug"
) )
var cleanupHandlers struct { var cleanupHandlers struct {

View File

@ -7,17 +7,18 @@ import (
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"restic"
"strings" "strings"
"time" "time"
"github.com/restic/restic/internal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic/archiver" "github.com/restic/restic/internal/archiver"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/filter" "github.com/restic/restic/internal/filter"
"restic/fs" "github.com/restic/restic/internal/fs"
) )
var cmdBackup = &cobra.Command{ var cmdBackup = &cobra.Command{

View File

@ -8,10 +8,10 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
"restic/backend" "github.com/restic/restic/internal/backend"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
var cmdCat = &cobra.Command{ var cmdCat = &cobra.Command{

View File

@ -8,9 +8,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
"restic/checker" "github.com/restic/restic/internal/checker"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
var cmdCheck = &cobra.Command{ var cmdCheck = &cobra.Command{

View File

@ -11,12 +11,12 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/pack" "github.com/restic/restic/internal/pack"
"restic/repository" "github.com/restic/restic/internal/repository"
"restic/worker" "github.com/restic/restic/internal/worker"
) )
var cmdDump = &cobra.Command{ var cmdDump = &cobra.Command{

View File

@ -9,9 +9,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
var cmdFind = &cobra.Command{ var cmdFind = &cobra.Command{

View File

@ -3,10 +3,11 @@ package main
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"restic"
"sort" "sort"
"strings" "strings"
"github.com/restic/restic/internal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -2,8 +2,9 @@ package main
import ( import (
"context" "context"
"restic/errors"
"restic/repository" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/repository"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,9 +3,10 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
"restic"
"restic/errors" "github.com/restic/restic/internal"
"restic/repository" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/repository"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,9 +3,10 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
"restic"
"restic/errors" "github.com/restic/restic/internal"
"restic/index" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/index"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -6,9 +6,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
var cmdLs = &cobra.Command{ var cmdLs = &cobra.Command{

View File

@ -1,8 +1,8 @@
package main package main
import ( import (
"restic" "github.com/restic/restic/internal"
"restic/migrations" "github.com/restic/restic/internal/migrations"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -6,15 +6,16 @@ package main
import ( import (
"context" "context"
"os" "os"
"restic"
"github.com/restic/restic/internal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/errors" "github.com/restic/restic/internal/errors"
resticfs "restic/fs" resticfs "github.com/restic/restic/internal/fs"
"restic/fuse" "github.com/restic/restic/internal/fuse"
systemFuse "bazil.org/fuse" systemFuse "bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"

View File

@ -2,7 +2,8 @@ package main
import ( import (
"fmt" "fmt"
"restic/options"
"github.com/restic/restic/internal/options"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -2,13 +2,14 @@ package main
import ( import (
"fmt" "fmt"
"restic"
"restic/debug"
"restic/errors"
"restic/index"
"restic/repository"
"time" "time"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/index"
"github.com/restic/restic/internal/repository"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -2,8 +2,9 @@ package main
import ( import (
"context" "context"
"restic"
"restic/index" "github.com/restic/restic/internal"
"github.com/restic/restic/internal/index"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -1,10 +1,10 @@
package main package main
import ( import (
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/filter" "github.com/restic/restic/internal/filter"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
) )
var cmdSnapshots = &cobra.Command{ var cmdSnapshots = &cobra.Command{

View File

@ -5,10 +5,10 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
var cmdTag = &cobra.Command{ var cmdTag = &cobra.Command{

View File

@ -2,7 +2,8 @@ package main
import ( import (
"context" "context"
"restic"
"github.com/restic/restic/internal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,8 +3,8 @@ package main
import ( import (
"context" "context"
"restic" "github.com/restic/restic/internal"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
// FindFilteredSnapshots yields Snapshots, either given explicitly by `snapshotIDs` or filtered from the list of all snapshots. // FindFilteredSnapshots yields Snapshots, either given explicitly by `snapshotIDs` or filtered from the list of all snapshots.

View File

@ -6,7 +6,7 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"restic" "github.com/restic/restic/internal"
) )
func formatBytes(c uint64) string { func formatBytes(c uint64) string {

View File

@ -6,23 +6,24 @@ import (
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"restic"
"runtime" "runtime"
"strings" "strings"
"syscall" "syscall"
"restic/backend/b2" "github.com/restic/restic/internal"
"restic/backend/local"
"restic/backend/location"
"restic/backend/rest"
"restic/backend/s3"
"restic/backend/sftp"
"restic/backend/swift"
"restic/debug"
"restic/options"
"restic/repository"
"restic/errors" "github.com/restic/restic/internal/backend/b2"
"github.com/restic/restic/internal/backend/local"
"github.com/restic/restic/internal/backend/location"
"github.com/restic/restic/internal/backend/rest"
"github.com/restic/restic/internal/backend/s3"
"github.com/restic/restic/internal/backend/sftp"
"github.com/restic/restic/internal/backend/swift"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/options"
"github.com/restic/restic/internal/repository"
"github.com/restic/restic/internal/errors"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
) )

View File

@ -7,8 +7,9 @@ import (
"net/http" "net/http"
_ "net/http/pprof" _ "net/http/pprof"
"os" "os"
"restic/errors"
"restic/repository" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/repository"
"github.com/pkg/profile" "github.com/pkg/profile"
) )

View File

@ -12,9 +12,9 @@ import (
"testing" "testing"
"time" "time"
"restic" "github.com/restic/restic/internal"
"restic/repository" "github.com/restic/restic/internal/repository"
. "restic/test" . "github.com/restic/restic/internal/test"
) )
const ( const (

View File

@ -9,9 +9,9 @@ import (
"runtime" "runtime"
"testing" "testing"
"restic/options" "github.com/restic/restic/internal/options"
"restic/repository" "github.com/restic/restic/internal/repository"
. "restic/test" . "github.com/restic/restic/internal/test"
) )
type dirEntry struct { type dirEntry struct {

View File

@ -12,18 +12,19 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"
"restic"
"strings" "strings"
"syscall" "syscall"
"testing" "testing"
"time" "time"
"restic/errors" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/errors"
"restic/filter"
"restic/repository" "github.com/restic/restic/internal/debug"
. "restic/test" "github.com/restic/restic/internal/filter"
"github.com/restic/restic/internal/repository"
. "github.com/restic/restic/internal/test"
) )
func parseIDsFromReader(t testing.TB, rd io.Reader) restic.IDs { func parseIDsFromReader(t testing.TB, rd io.Reader) restic.IDs {

View File

@ -2,8 +2,9 @@ package main
import ( import (
"path/filepath" "path/filepath"
. "restic/test"
"testing" "testing"
. "github.com/restic/restic/internal/test"
) )
func TestRestoreLocalLayout(t *testing.T) { func TestRestoreLocalLayout(t *testing.T) {

View File

@ -7,9 +7,9 @@ import (
"sync" "sync"
"time" "time"
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
var globalLocks struct { var globalLocks struct {

View File

@ -6,14 +6,15 @@ import (
"fmt" "fmt"
"log" "log"
"os" "os"
"restic"
"restic/debug"
"restic/options"
"runtime" "runtime"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/options"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// cmdRoot is the base command when no other command has been specified. // cmdRoot is the base command when no other command has been specified.

View File

@ -3,11 +3,12 @@ package archiver
import ( import (
"context" "context"
"io" "io"
"restic"
"restic/debug"
"time" "time"
"restic/errors" "github.com/restic/restic/internal"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/restic/chunker" "github.com/restic/chunker"
) )

View File

@ -6,10 +6,11 @@ import (
"errors" "errors"
"io" "io"
"math/rand" "math/rand"
"restic"
"restic/checker"
"restic/repository"
"testing" "testing"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/checker"
"github.com/restic/restic/internal/repository"
) )
func loadBlob(t *testing.T, repo restic.Repository, id restic.ID, buf []byte) int { func loadBlob(t *testing.T, repo restic.Repository, id restic.ID, buf []byte) int {

View File

@ -7,17 +7,18 @@ import (
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"restic"
"sort" "sort"
"sync" "sync"
"time" "time"
"restic/errors" "github.com/restic/restic/internal"
"restic/walk"
"restic/debug" "github.com/restic/restic/internal/errors"
"restic/fs" "github.com/restic/restic/internal/walk"
"restic/pipe"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/fs"
"github.com/restic/restic/internal/pipe"
"github.com/restic/chunker" "github.com/restic/chunker"
) )

View File

@ -9,12 +9,12 @@ import (
"testing" "testing"
"time" "time"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic" "github.com/restic/restic/internal"
"restic/archiver" "github.com/restic/restic/internal/archiver"
"restic/mock" "github.com/restic/restic/internal/mock"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
const parallelSaves = 50 const parallelSaves = 50

View File

@ -5,8 +5,8 @@ import (
"os" "os"
"testing" "testing"
"restic/pipe" "github.com/restic/restic/internal/pipe"
"restic/walk" "github.com/restic/restic/internal/walk"
) )
var treeJobs = []string{ var treeJobs = []string{

View File

@ -7,14 +7,14 @@ import (
"testing" "testing"
"time" "time"
"restic" "github.com/restic/restic/internal"
"restic/archiver" "github.com/restic/restic/internal/archiver"
"restic/checker" "github.com/restic/restic/internal/checker"
"restic/crypto" "github.com/restic/restic/internal/crypto"
"restic/repository" "github.com/restic/restic/internal/repository"
. "restic/test" . "github.com/restic/restic/internal/test"
"restic/errors" "github.com/restic/restic/internal/errors"
"github.com/restic/chunker" "github.com/restic/chunker"
) )

View File

@ -2,8 +2,9 @@ package archiver
import ( import (
"context" "context"
"restic"
"testing" "testing"
"github.com/restic/restic/internal"
) )
// TestSnapshot creates a new snapshot of path. // TestSnapshot creates a new snapshot of path.

View File

@ -4,12 +4,13 @@ import (
"context" "context"
"io" "io"
"path" "path"
"restic"
"strings" "strings"
"restic/backend" "github.com/restic/restic/internal"
"restic/debug"
"restic/errors" "github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/kurin/blazer/b2" "github.com/kurin/blazer/b2"
) )

View File

@ -7,11 +7,11 @@ import (
"testing" "testing"
"time" "time"
"restic" "github.com/restic/restic/internal"
"restic/backend/b2" "github.com/restic/restic/internal/backend/b2"
"restic/backend/test" "github.com/restic/restic/internal/backend/test"
. "restic/test" . "github.com/restic/restic/internal/test"
) )
func newB2TestSuite(t testing.TB) *test.Suite { func newB2TestSuite(t testing.TB) *test.Suite {

View File

@ -5,8 +5,8 @@ import (
"regexp" "regexp"
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/options" "github.com/restic/restic/internal/options"
) )
// Config contains all configuration necessary to connect to an b2 compatible // Config contains all configuration necessary to connect to an b2 compatible

View File

@ -3,8 +3,9 @@ package backend
import ( import (
"net" "net"
"net/http" "net/http"
"restic/debug"
"time" "time"
"github.com/restic/restic/internal/debug"
) )
// Transport returns a new http.RoundTripper with default settings applied. // Transport returns a new http.RoundTripper with default settings applied.

View File

@ -5,10 +5,11 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"
"restic"
"restic/debug" "github.com/restic/restic/internal"
"restic/errors" "github.com/restic/restic/internal/debug"
"restic/fs" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/fs"
) )
// Layout computes paths for file name storage. // Layout computes paths for file name storage.

View File

@ -2,7 +2,8 @@ package backend
import ( import (
"encoding/hex" "encoding/hex"
"restic"
"github.com/restic/restic/internal"
) )
// DefaultLayout implements the default layout for local and sftp backends, as // DefaultLayout implements the default layout for local and sftp backends, as

View File

@ -1,6 +1,6 @@
package backend package backend
import "restic" import "github.com/restic/restic/internal"
// RESTLayout implements the default layout for the REST protocol. // RESTLayout implements the default layout for the REST protocol.
type RESTLayout struct { type RESTLayout struct {

View File

@ -1,6 +1,6 @@
package backend package backend
import "restic" import "github.com/restic/restic/internal"
// S3LegacyLayout implements the old layout used for s3 cloud storage backends, as // S3LegacyLayout implements the old layout used for s3 cloud storage backends, as
// described in the Design document. // described in the Design document.

View File

@ -5,10 +5,11 @@ import (
"path" "path"
"path/filepath" "path/filepath"
"reflect" "reflect"
"restic"
. "restic/test"
"sort" "sort"
"testing" "testing"
"github.com/restic/restic/internal"
. "github.com/restic/restic/internal/test"
) )
func TestDefaultLayout(t *testing.T) { func TestDefaultLayout(t *testing.T) {

View File

@ -3,8 +3,8 @@ package local
import ( import (
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/options" "github.com/restic/restic/internal/options"
) )
// Config holds all information needed to open a local repository. // Config holds all information needed to open a local repository.

View File

@ -3,9 +3,10 @@ package local
import ( import (
"context" "context"
"path/filepath" "path/filepath"
"restic"
. "restic/test"
"testing" "testing"
"github.com/restic/restic/internal"
. "github.com/restic/restic/internal/test"
) )
func TestLayout(t *testing.T) { func TestLayout(t *testing.T) {

View File

@ -5,13 +5,14 @@ import (
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"restic"
"restic/errors" "github.com/restic/restic/internal"
"restic/backend" "github.com/restic/restic/internal/errors"
"restic/debug"
"restic/fs" "github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/fs"
) )
// Local is a backend in a local directory. // Local is a backend in a local directory.

View File

@ -2,12 +2,13 @@ package local_test
import ( import (
"io/ioutil" "io/ioutil"
"restic"
"testing" "testing"
"restic/backend/local" "github.com/restic/restic/internal"
"restic/backend/test"
. "restic/test" "github.com/restic/restic/internal/backend/local"
"github.com/restic/restic/internal/backend/test"
. "github.com/restic/restic/internal/test"
) )
func newTestSuite(t testing.TB) *test.Suite { func newTestSuite(t testing.TB) *test.Suite {

View File

@ -4,7 +4,8 @@ package local
import ( import (
"os" "os"
"restic/fs"
"github.com/restic/restic/internal/fs"
) )
// set file to readonly // set file to readonly

View File

@ -4,13 +4,13 @@ package location
import ( import (
"strings" "strings"
"restic/backend/b2" "github.com/restic/restic/internal/backend/b2"
"restic/backend/local" "github.com/restic/restic/internal/backend/local"
"restic/backend/rest" "github.com/restic/restic/internal/backend/rest"
"restic/backend/s3" "github.com/restic/restic/internal/backend/s3"
"restic/backend/sftp" "github.com/restic/restic/internal/backend/sftp"
"restic/backend/swift" "github.com/restic/restic/internal/backend/swift"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// Location specifies the location of a repository, including the method of // Location specifies the location of a repository, including the method of

View File

@ -5,12 +5,12 @@ import (
"reflect" "reflect"
"testing" "testing"
"restic/backend/b2" "github.com/restic/restic/internal/backend/b2"
"restic/backend/local" "github.com/restic/restic/internal/backend/local"
"restic/backend/rest" "github.com/restic/restic/internal/backend/rest"
"restic/backend/s3" "github.com/restic/restic/internal/backend/s3"
"restic/backend/sftp" "github.com/restic/restic/internal/backend/sftp"
"restic/backend/swift" "github.com/restic/restic/internal/backend/swift"
) )
func parseURL(s string) *url.URL { func parseURL(s string) *url.URL {

View File

@ -5,12 +5,13 @@ import (
"context" "context"
"io" "io"
"io/ioutil" "io/ioutil"
"restic"
"sync" "sync"
"restic/errors" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/debug"
) )
type memMap map[restic.Handle][]byte type memMap map[restic.Handle][]byte

View File

@ -2,13 +2,14 @@ package mem_test
import ( import (
"context" "context"
"restic"
"testing" "testing"
"restic/errors" "github.com/restic/restic/internal"
"restic/backend/mem" "github.com/restic/restic/internal/errors"
"restic/backend/test"
"github.com/restic/restic/internal/backend/mem"
"github.com/restic/restic/internal/backend/test"
) )
type memConfig struct { type memConfig struct {

View File

@ -4,8 +4,8 @@ import (
"net/url" "net/url"
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/options" "github.com/restic/restic/internal/options"
) )
// Config contains all configuration necessary to connect to a REST server. // Config contains all configuration necessary to connect to a REST server.

View File

@ -9,15 +9,16 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"path" "path"
"restic"
"strings" "strings"
"github.com/restic/restic/internal"
"golang.org/x/net/context/ctxhttp" "golang.org/x/net/context/ctxhttp"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/backend" "github.com/restic/restic/internal/backend"
) )
// make sure the rest backend implements restic.Backend // make sure the rest backend implements restic.Backend

View File

@ -7,13 +7,14 @@ import (
"net/url" "net/url"
"os" "os"
"os/exec" "os/exec"
"restic"
"testing" "testing"
"time" "time"
"restic/backend/rest" "github.com/restic/restic/internal"
"restic/backend/test"
. "restic/test" "github.com/restic/restic/internal/backend/rest"
"github.com/restic/restic/internal/backend/test"
. "github.com/restic/restic/internal/test"
) )
func runRESTServer(ctx context.Context, t testing.TB, dir string) func() { func runRESTServer(ctx context.Context, t testing.TB, dir string) func() {

View File

@ -5,8 +5,8 @@ import (
"path" "path"
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/options" "github.com/restic/restic/internal/options"
) )
// Config contains all configuration necessary to connect to an s3 compatible // Config contains all configuration necessary to connect to an s3 compatible

View File

@ -7,17 +7,18 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
"restic"
"strings" "strings"
"time" "time"
"restic/backend" "github.com/restic/restic/internal"
"restic/errors"
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/errors"
"github.com/minio/minio-go" "github.com/minio/minio-go"
"github.com/minio/minio-go/pkg/credentials" "github.com/minio/minio-go/pkg/credentials"
"restic/debug" "github.com/restic/restic/internal/debug"
) )
// Backend stores data on an S3 endpoint. // Backend stores data on an S3 endpoint.

View File

@ -11,13 +11,14 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"restic"
"testing" "testing"
"time" "time"
"restic/backend/s3" "github.com/restic/restic/internal"
"restic/backend/test"
. "restic/test" "github.com/restic/restic/internal/backend/s3"
"github.com/restic/restic/internal/backend/test"
. "github.com/restic/restic/internal/test"
) )
func mkdir(t testing.TB, dir string) { func mkdir(t testing.TB, dir string) {

View File

@ -1,6 +1,6 @@
package backend package backend
import "restic/errors" import "github.com/restic/restic/internal/errors"
// Semaphore limits access to a restricted resource. // Semaphore limits access to a restricted resource.
type Semaphore struct { type Semaphore struct {

View File

@ -5,8 +5,8 @@ import (
"path" "path"
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/options" "github.com/restic/restic/internal/options"
) )
// Config collects all information required to connect to an sftp server. // Config collects all information required to connect to an sftp server.

View File

@ -4,10 +4,11 @@ import (
"context" "context"
"fmt" "fmt"
"path/filepath" "path/filepath"
"restic"
"restic/backend/sftp"
. "restic/test"
"testing" "testing"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/backend/sftp"
. "github.com/restic/restic/internal/test"
) )
func TestLayout(t *testing.T) { func TestLayout(t *testing.T) {

View File

@ -8,14 +8,15 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"restic"
"strings" "strings"
"time" "time"
"restic/errors" "github.com/restic/restic/internal"
"restic/backend" "github.com/restic/restic/internal/errors"
"restic/debug"
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/debug"
"github.com/pkg/sftp" "github.com/pkg/sftp"
) )

View File

@ -5,14 +5,15 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"restic"
"restic/backend/sftp"
"restic/backend/test"
"restic/errors"
"strings" "strings"
"testing" "testing"
. "restic/test" "github.com/restic/restic/internal"
"github.com/restic/restic/internal/backend/sftp"
"github.com/restic/restic/internal/backend/test"
"github.com/restic/restic/internal/errors"
. "github.com/restic/restic/internal/test"
) )
func findSFTPServerBinary() string { func findSFTPServerBinary() string {

View File

@ -1,8 +1,9 @@
package sftp package sftp
import ( import (
"restic/errors"
"unicode" "unicode"
"github.com/restic/restic/internal/errors"
) )
// shellSplitter splits a command string into separater arguments. It supports // shellSplitter splits a command string into separater arguments. It supports

View File

@ -2,9 +2,10 @@ package swift
import ( import (
"os" "os"
"restic/errors"
"restic/options"
"strings" "strings"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/options"
) )
// Config contains basic configuration needed to specify swift location for a swift server // Config contains basic configuration needed to specify swift location for a swift server

View File

@ -7,13 +7,14 @@ import (
"net/http" "net/http"
"path" "path"
"path/filepath" "path/filepath"
"restic"
"restic/backend"
"restic/debug"
"restic/errors"
"strings" "strings"
"time" "time"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/ncw/swift" "github.com/ncw/swift"
) )

View File

@ -4,15 +4,16 @@ import (
"context" "context"
"fmt" "fmt"
"os" "os"
"restic"
"testing" "testing"
"time" "time"
"restic/errors" "github.com/restic/restic/internal"
. "restic/test"
"restic/backend/swift" "github.com/restic/restic/internal/errors"
"restic/backend/test" . "github.com/restic/restic/internal/test"
"github.com/restic/restic/internal/backend/swift"
"github.com/restic/restic/internal/backend/test"
) )
func newSwiftTestSuite(t testing.TB) *test.Suite { func newSwiftTestSuite(t testing.TB) *test.Suite {

View File

@ -4,9 +4,10 @@ import (
"bytes" "bytes"
"context" "context"
"io" "io"
"restic"
"restic/test"
"testing" "testing"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/test"
) )
func saveRandomFile(t testing.TB, be restic.Backend, length int) ([]byte, restic.Handle) { func saveRandomFile(t testing.TB, be restic.Backend, length int) ([]byte, restic.Handle) {

View File

@ -2,11 +2,12 @@ package test
import ( import (
"reflect" "reflect"
"restic"
"restic/test"
"strings" "strings"
"testing" "testing"
"time" "time"
"github.com/restic/restic/internal"
"github.com/restic/restic/internal/test"
) )
// Suite implements a test suite for restic backends. // Suite implements a test suite for restic backends.

View File

@ -9,16 +9,17 @@ import (
"math/rand" "math/rand"
"os" "os"
"reflect" "reflect"
"restic"
"restic/errors"
"sort" "sort"
"strings" "strings"
"testing" "testing"
"time" "time"
"restic/test" "github.com/restic/restic/internal"
"github.com/restic/restic/internal/errors"
"restic/backend" "github.com/restic/restic/internal/test"
"github.com/restic/restic/internal/backend"
) )
func seedRand(t testing.TB) { func seedRand(t testing.TB) {

View File

@ -2,12 +2,13 @@ package test_test
import ( import (
"context" "context"
"restic"
"restic/errors"
"testing" "testing"
"restic/backend/mem" "github.com/restic/restic/internal"
"restic/backend/test" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/backend/mem"
"github.com/restic/restic/internal/backend/test"
) )
//go:generate go run generate_test_list.go //go:generate go run generate_test_list.go

View File

@ -4,7 +4,8 @@ import (
"context" "context"
"io" "io"
"io/ioutil" "io/ioutil"
"restic"
"github.com/restic/restic/internal"
) )
// LoadAll reads all data stored in the backend for the handle. // LoadAll reads all data stored in the backend for the handle.

View File

@ -4,12 +4,13 @@ import (
"bytes" "bytes"
"context" "context"
"math/rand" "math/rand"
"restic"
"testing" "testing"
"restic/backend" "github.com/restic/restic/internal"
"restic/backend/mem"
. "restic/test" "github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/backend/mem"
. "github.com/restic/restic/internal/test"
) )
const KiB = 1 << 10 const KiB = 1 << 10

View File

@ -2,7 +2,8 @@ package restic
import ( import (
"context" "context"
"restic/errors"
"github.com/restic/restic/internal/errors"
) )
// ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix // ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix

View File

@ -3,7 +3,7 @@ package restic
import ( import (
"fmt" "fmt"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// Blob is one part of a file or a tree. // Blob is one part of a file or a tree.

View File

@ -1,6 +1,6 @@
package restic package restic
import "restic/crypto" import "github.com/restic/restic/internal/crypto"
// NewBlobBuffer returns a buffer that is large enough to hold a blob of size // NewBlobBuffer returns a buffer that is large enough to hold a blob of size
// plaintext bytes, including the crypto overhead. // plaintext bytes, including the crypto overhead.

View File

@ -8,14 +8,14 @@ import (
"os" "os"
"sync" "sync"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/fs" "github.com/restic/restic/internal/fs"
"restic/hashing" "github.com/restic/restic/internal/hashing"
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
"restic/pack" "github.com/restic/restic/internal/pack"
"restic/repository" "github.com/restic/restic/internal/repository"
) )
// Checker runs various checks on a repository. It is advisable to create an // Checker runs various checks on a repository. It is advisable to create an

View File

@ -8,11 +8,11 @@ import (
"sort" "sort"
"testing" "testing"
"restic" "github.com/restic/restic/internal"
"restic/archiver" "github.com/restic/restic/internal/archiver"
"restic/checker" "github.com/restic/restic/internal/checker"
"restic/repository" "github.com/restic/restic/internal/repository"
"restic/test" "github.com/restic/restic/internal/test"
) )
var checkerTestData = filepath.Join("testdata", "checker-test-repo.tar.gz") var checkerTestData = filepath.Join("testdata", "checker-test-repo.tar.gz")

View File

@ -2,8 +2,9 @@ package checker
import ( import (
"context" "context"
"restic"
"testing" "testing"
"github.com/restic/restic/internal"
) )
// TestCheckRepo runs the checker on repo. // TestCheckRepo runs the checker on repo.

View File

@ -4,9 +4,9 @@ import (
"context" "context"
"testing" "testing"
"restic/errors" "github.com/restic/restic/internal/errors"
"restic/debug" "github.com/restic/restic/internal/debug"
"github.com/restic/chunker" "github.com/restic/chunker"
) )

View File

@ -2,10 +2,11 @@ package restic_test
import ( import (
"context" "context"
"restic"
"testing" "testing"
. "restic/test" "github.com/restic/restic/internal"
. "github.com/restic/restic/internal/test"
) )
type saver func(restic.FileType, interface{}) (restic.ID, error) type saver func(restic.FileType, interface{}) (restic.ID, error)

View File

@ -7,7 +7,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"restic/errors" "github.com/restic/restic/internal/errors"
"golang.org/x/crypto/poly1305" "golang.org/x/crypto/poly1305"
) )

View File

@ -6,8 +6,8 @@ import (
"io" "io"
"testing" "testing"
"restic/crypto" "github.com/restic/restic/internal/crypto"
. "restic/test" . "github.com/restic/restic/internal/test"
"github.com/restic/chunker" "github.com/restic/chunker"
) )

View File

@ -4,7 +4,7 @@ import (
"crypto/rand" "crypto/rand"
"time" "time"
"restic/errors" "github.com/restic/restic/internal/errors"
sscrypt "github.com/elithrar/simple-scrypt" sscrypt "github.com/elithrar/simple-scrypt"
"golang.org/x/crypto/scrypt" "golang.org/x/crypto/scrypt"

View File

@ -8,11 +8,12 @@ import (
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"restic/fs"
"runtime" "runtime"
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/fs"
"github.com/restic/restic/internal/errors"
) )
var opts struct { var opts struct {

View File

@ -9,7 +9,8 @@ import (
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
"os" "os"
"restic/errors"
"github.com/restic/restic/internal/errors"
) )
type eofDetectRoundTripper struct { type eofDetectRoundTripper struct {

View File

@ -3,7 +3,7 @@ package restic
import ( import (
"fmt" "fmt"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// FileType is the type of a file in the backend. // FileType is the type of a file in the backend.

View File

@ -4,7 +4,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// ErrBadString is returned when Match is called with the empty string as the // ErrBadString is returned when Match is called with the empty string as the

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"testing" "testing"
"restic/filter" "github.com/restic/restic/internal/filter"
) )
var matchTests = []struct { var matchTests = []struct {

View File

@ -8,12 +8,13 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"restic"
"sort" "sort"
"testing" "testing"
"time" "time"
"restic/repository" "github.com/restic/restic/internal"
"github.com/restic/restic/internal/repository"
) )
func loadIDSet(t testing.TB, filename string) restic.BlobSet { func loadIDSet(t testing.TB, filename string) restic.BlobSet {

View File

@ -6,7 +6,7 @@ import (
"os" "os"
"syscall" "syscall"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// DeviceID extracts the device ID from an os.FileInfo object by casting it // DeviceID extracts the device ID from an os.FileInfo object by casting it

View File

@ -5,7 +5,7 @@ package fs
import ( import (
"os" "os"
"restic/errors" "github.com/restic/restic/internal/errors"
) )
// DeviceID extracts the device ID from an os.FileInfo object by casting it // DeviceID extracts the device ID from an os.FileInfo object by casting it

View File

@ -4,7 +4,7 @@
package fuse package fuse
import ( import (
"restic" "github.com/restic/restic/internal"
"golang.org/x/net/context" "golang.org/x/net/context"
) )

View File

@ -10,8 +10,8 @@ import (
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
"golang.org/x/net/context" "golang.org/x/net/context"
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
) )
// Statically ensure that *dir implement those interface // Statically ensure that *dir implement those interface

View File

@ -4,10 +4,10 @@
package fuse package fuse
import ( import (
"restic/errors" "github.com/restic/restic/internal/errors"
"restic" "github.com/restic/restic/internal"
"restic/debug" "github.com/restic/restic/internal/debug"
"bazil.org/fuse" "bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"

View File

@ -11,13 +11,13 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"restic/repository" "github.com/restic/restic/internal/repository"
"bazil.org/fuse" "bazil.org/fuse"
"bazil.org/fuse/fs" "bazil.org/fuse/fs"
"restic" "github.com/restic/restic/internal"
. "restic/test" . "github.com/restic/restic/internal/test"
) )
func testRead(t testing.TB, f *file, offset, length int, data []byte) { func testRead(t testing.TB, f *file, offset, length int, data []byte) {

Some files were not shown because too many files have changed in this diff Show More