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,12 +4,13 @@ import (
"context"
"io"
"path"
"restic"
"strings"
"restic/backend"
"restic/debug"
"restic/errors"
"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/kurin/blazer/b2"
)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,13 +5,14 @@ import (
"io"
"os"
"path/filepath"
"restic"
"restic/errors"
"github.com/restic/restic/internal"
"restic/backend"
"restic/debug"
"restic/fs"
"github.com/restic/restic/internal/errors"
"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.

View File

@@ -2,12 +2,13 @@ package local_test
import (
"io/ioutil"
"restic"
"testing"
"restic/backend/local"
"restic/backend/test"
. "restic/test"
"github.com/restic/restic/internal"
"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 {

View File

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

View File

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

View File

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

View File

@@ -5,12 +5,13 @@ import (
"context"
"io"
"io/ioutil"
"restic"
"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

View File

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

View File

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

View File

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

View File

@@ -7,13 +7,14 @@ import (
"net/url"
"os"
"os/exec"
"restic"
"testing"
"time"
"restic/backend/rest"
"restic/backend/test"
. "restic/test"
"github.com/restic/restic/internal"
"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() {

View File

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

View File

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

View File

@@ -11,13 +11,14 @@ import (
"os"
"os/exec"
"path/filepath"
"restic"
"testing"
"time"
"restic/backend/s3"
"restic/backend/test"
. "restic/test"
"github.com/restic/restic/internal"
"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) {

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,14 +5,15 @@ import (
"io/ioutil"
"os"
"path/filepath"
"restic"
"restic/backend/sftp"
"restic/backend/test"
"restic/errors"
"strings"
"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 {

View File

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

View File

@@ -2,9 +2,10 @@ package swift
import (
"os"
"restic/errors"
"restic/options"
"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

View File

@@ -7,13 +7,14 @@ import (
"net/http"
"path"
"path/filepath"
"restic"
"restic/backend"
"restic/debug"
"restic/errors"
"strings"
"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"
)

View File

@@ -4,15 +4,16 @@ import (
"context"
"fmt"
"os"
"restic"
"testing"
"time"
"restic/errors"
. "restic/test"
"github.com/restic/restic/internal"
"restic/backend/swift"
"restic/backend/test"
"github.com/restic/restic/internal/errors"
. "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 {

View File

@@ -4,9 +4,10 @@ import (
"bytes"
"context"
"io"
"restic"
"restic/test"
"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) {

View File

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

View File

@@ -9,16 +9,17 @@ import (
"math/rand"
"os"
"reflect"
"restic"
"restic/errors"
"sort"
"strings"
"testing"
"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) {

View File

@@ -2,12 +2,13 @@ package test_test
import (
"context"
"restic"
"restic/errors"
"testing"
"restic/backend/mem"
"restic/backend/test"
"github.com/restic/restic/internal"
"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

View File

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

View File

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