diff --git a/src/cmds/restic/cmd_backup.go b/src/cmds/restic/cmd_backup.go index b5c567de..9efb2720 100644 --- a/src/cmds/restic/cmd_backup.go +++ b/src/cmds/restic/cmd_backup.go @@ -2,7 +2,6 @@ package main import ( "bufio" - "errors" "fmt" "os" "path/filepath" @@ -14,6 +13,8 @@ import ( "strings" "time" + "github.com/pkg/errors" + "golang.org/x/crypto/ssh/terminal" ) diff --git a/src/cmds/restic/cmd_cat.go b/src/cmds/restic/cmd_cat.go index 959dfabd..f8a96772 100644 --- a/src/cmds/restic/cmd_cat.go +++ b/src/cmds/restic/cmd_cat.go @@ -2,10 +2,11 @@ package main import ( "encoding/json" - "errors" "fmt" "os" + "github.com/pkg/errors" + "restic" "restic/backend" "restic/debug" diff --git a/src/cmds/restic/cmd_check.go b/src/cmds/restic/cmd_check.go index 9bcd2791..cbb79f8c 100644 --- a/src/cmds/restic/cmd_check.go +++ b/src/cmds/restic/cmd_check.go @@ -1,11 +1,12 @@ package main import ( - "errors" "fmt" "os" "time" + "github.com/pkg/errors" + "golang.org/x/crypto/ssh/terminal" "restic" diff --git a/src/cmds/restic/cmd_dump.go b/src/cmds/restic/cmd_dump.go index dc25f37b..31ed114a 100644 --- a/src/cmds/restic/cmd_dump.go +++ b/src/cmds/restic/cmd_dump.go @@ -8,6 +8,8 @@ import ( "io" "os" + "github.com/pkg/errors" + "restic" "restic/backend" "restic/pack" diff --git a/src/cmds/restic/cmd_init.go b/src/cmds/restic/cmd_init.go index 887d3416..4bfc4a5c 100644 --- a/src/cmds/restic/cmd_init.go +++ b/src/cmds/restic/cmd_init.go @@ -1,7 +1,7 @@ package main import ( - "errors" + "github.com/pkg/errors" "restic/repository" ) diff --git a/src/cmds/restic/cmd_key.go b/src/cmds/restic/cmd_key.go index 46e5b6bf..42f0ee6a 100644 --- a/src/cmds/restic/cmd_key.go +++ b/src/cmds/restic/cmd_key.go @@ -1,9 +1,10 @@ package main import ( - "errors" "fmt" + "github.com/pkg/errors" + "restic/backend" "restic/repository" ) diff --git a/src/cmds/restic/cmd_list.go b/src/cmds/restic/cmd_list.go index 3bfb5af9..57310b6f 100644 --- a/src/cmds/restic/cmd_list.go +++ b/src/cmds/restic/cmd_list.go @@ -1,9 +1,10 @@ package main import ( - "errors" "fmt" + "github.com/pkg/errors" + "restic/backend" ) diff --git a/src/cmds/restic/cmd_restore.go b/src/cmds/restic/cmd_restore.go index 97b77ec1..84a9a9b0 100644 --- a/src/cmds/restic/cmd_restore.go +++ b/src/cmds/restic/cmd_restore.go @@ -1,9 +1,10 @@ package main import ( - "errors" "fmt" + "github.com/pkg/errors" + "restic" "restic/backend" "restic/debug" diff --git a/src/cmds/restic/global.go b/src/cmds/restic/global.go index 511628a4..c16263cb 100644 --- a/src/cmds/restic/global.go +++ b/src/cmds/restic/global.go @@ -1,7 +1,6 @@ package main import ( - "errors" "fmt" "io" "os" @@ -9,6 +8,8 @@ import ( "strings" "syscall" + "github.com/pkg/errors" + "restic/backend" "restic/backend/local" "restic/backend/rest" diff --git a/src/cmds/restic/main.go b/src/cmds/restic/main.go index 19d81e77..f9a4ec80 100644 --- a/src/cmds/restic/main.go +++ b/src/cmds/restic/main.go @@ -2,11 +2,12 @@ package main import ( "fmt" - "github.com/jessevdk/go-flags" "os" "restic" "restic/debug" "runtime" + + "github.com/jessevdk/go-flags" ) func init() { diff --git a/src/restic/archiver.go b/src/restic/archiver.go index cf245d2b..ae062a7f 100644 --- a/src/restic/archiver.go +++ b/src/restic/archiver.go @@ -2,7 +2,6 @@ package restic import ( "encoding/json" - "errors" "fmt" "io" "os" @@ -11,6 +10,8 @@ import ( "sync" "time" + "github.com/pkg/errors" + "restic/backend" "restic/debug" "restic/fs" diff --git a/src/restic/archiver_duplication_test.go b/src/restic/archiver_duplication_test.go index 56341a99..61f7aafb 100644 --- a/src/restic/archiver_duplication_test.go +++ b/src/restic/archiver_duplication_test.go @@ -2,13 +2,14 @@ package restic_test import ( "crypto/rand" - "errors" "io" mrand "math/rand" "sync" "testing" "time" + "github.com/pkg/errors" + "restic" "restic/backend" "restic/pack" diff --git a/src/restic/backend/generic.go b/src/restic/backend/generic.go index c528f899..7510ad0f 100644 --- a/src/restic/backend/generic.go +++ b/src/restic/backend/generic.go @@ -1,6 +1,6 @@ package backend -import "errors" +import "github.com/pkg/errors" // ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix // could be found. diff --git a/src/restic/backend/handle.go b/src/restic/backend/handle.go index 6bdf6af2..62ff00b0 100644 --- a/src/restic/backend/handle.go +++ b/src/restic/backend/handle.go @@ -1,8 +1,9 @@ package backend import ( - "errors" "fmt" + + "github.com/pkg/errors" ) // Handle is used to store and access data in a backend. diff --git a/src/restic/backend/id.go b/src/restic/backend/id.go index 11579270..a37e0ede 100644 --- a/src/restic/backend/id.go +++ b/src/restic/backend/id.go @@ -5,7 +5,8 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" - "errors" + + "github.com/pkg/errors" ) // Hash returns the ID for data. diff --git a/src/restic/backend/local/config.go b/src/restic/backend/local/config.go index 456f3c42..a430f9de 100644 --- a/src/restic/backend/local/config.go +++ b/src/restic/backend/local/config.go @@ -1,8 +1,9 @@ package local import ( - "errors" "strings" + + "github.com/pkg/errors" ) // ParseConfig parses a local backend config. diff --git a/src/restic/backend/local/local.go b/src/restic/backend/local/local.go index 9a85f7a5..d6b02a0b 100644 --- a/src/restic/backend/local/local.go +++ b/src/restic/backend/local/local.go @@ -1,13 +1,14 @@ package local import ( - "errors" "fmt" "io" "io/ioutil" "os" "path/filepath" + "github.com/pkg/errors" + "restic/backend" "restic/debug" "restic/fs" diff --git a/src/restic/backend/mem/mem_backend.go b/src/restic/backend/mem/mem_backend.go index 5682d491..239e2c89 100644 --- a/src/restic/backend/mem/mem_backend.go +++ b/src/restic/backend/mem/mem_backend.go @@ -1,10 +1,11 @@ package mem import ( - "errors" "io" "sync" + "github.com/pkg/errors" + "restic/backend" "restic/debug" ) diff --git a/src/restic/backend/mem/mem_backend_test.go b/src/restic/backend/mem/mem_backend_test.go index a65cdc24..cde3bda1 100644 --- a/src/restic/backend/mem/mem_backend_test.go +++ b/src/restic/backend/mem/mem_backend_test.go @@ -1,7 +1,7 @@ package mem_test import ( - "errors" + "github.com/pkg/errors" "restic/backend" "restic/backend/mem" diff --git a/src/restic/backend/mock_backend.go b/src/restic/backend/mock_backend.go index 921af4d6..70429acf 100644 --- a/src/restic/backend/mock_backend.go +++ b/src/restic/backend/mock_backend.go @@ -1,6 +1,6 @@ package backend -import "errors" +import "github.com/pkg/errors" // MockBackend implements a backend whose functions can be specified. This // should only be used for tests. diff --git a/src/restic/backend/rest/config.go b/src/restic/backend/rest/config.go index c4459344..61a73144 100644 --- a/src/restic/backend/rest/config.go +++ b/src/restic/backend/rest/config.go @@ -1,9 +1,10 @@ package rest import ( - "errors" "net/url" "strings" + + "github.com/pkg/errors" ) // Config contains all configuration necessary to connect to a REST server. diff --git a/src/restic/backend/rest/rest.go b/src/restic/backend/rest/rest.go index 125331d7..5894d75a 100644 --- a/src/restic/backend/rest/rest.go +++ b/src/restic/backend/rest/rest.go @@ -3,7 +3,6 @@ package rest import ( "bytes" "encoding/json" - "errors" "fmt" "io" "net/http" @@ -11,6 +10,8 @@ import ( "path" "strings" + "github.com/pkg/errors" + "restic/backend" ) diff --git a/src/restic/backend/rest/rest_test.go b/src/restic/backend/rest/rest_test.go index bbcfff9b..4e77cf61 100644 --- a/src/restic/backend/rest/rest_test.go +++ b/src/restic/backend/rest/rest_test.go @@ -1,11 +1,12 @@ package rest_test import ( - "errors" "fmt" "net/url" "os" + "github.com/pkg/errors" + "restic/backend" "restic/backend/rest" "restic/backend/test" diff --git a/src/restic/backend/s3/config.go b/src/restic/backend/s3/config.go index 5cd74ce7..70991363 100644 --- a/src/restic/backend/s3/config.go +++ b/src/restic/backend/s3/config.go @@ -1,10 +1,11 @@ package s3 import ( - "errors" "net/url" "path" "strings" + + "github.com/pkg/errors" ) // Config contains all configuration necessary to connect to an s3 compatible diff --git a/src/restic/backend/s3/s3.go b/src/restic/backend/s3/s3.go index c4e1aae5..ff3ff627 100644 --- a/src/restic/backend/s3/s3.go +++ b/src/restic/backend/s3/s3.go @@ -2,10 +2,11 @@ package s3 import ( "bytes" - "errors" "io" "strings" + "github.com/pkg/errors" + "github.com/minio/minio-go" "restic/backend" diff --git a/src/restic/backend/s3/s3_test.go b/src/restic/backend/s3/s3_test.go index 586398de..6fd9c3bf 100644 --- a/src/restic/backend/s3/s3_test.go +++ b/src/restic/backend/s3/s3_test.go @@ -1,11 +1,12 @@ package s3_test import ( - "errors" "fmt" "net/url" "os" + "github.com/pkg/errors" + "restic/backend" "restic/backend/s3" "restic/backend/test" diff --git a/src/restic/backend/sftp/config.go b/src/restic/backend/sftp/config.go index e6dfd0d2..942efc3e 100644 --- a/src/restic/backend/sftp/config.go +++ b/src/restic/backend/sftp/config.go @@ -1,11 +1,12 @@ package sftp import ( - "errors" "fmt" "net/url" "path" "strings" + + "github.com/pkg/errors" ) // Config collects all information required to connect to an sftp server. diff --git a/src/restic/backend/sftp/sftp.go b/src/restic/backend/sftp/sftp.go index 577f5bbb..e023bf1b 100644 --- a/src/restic/backend/sftp/sftp.go +++ b/src/restic/backend/sftp/sftp.go @@ -4,7 +4,6 @@ import ( "bufio" "crypto/rand" "encoding/hex" - "errors" "fmt" "io" "os" @@ -13,6 +12,8 @@ import ( "strings" "time" + "github.com/pkg/errors" + "restic/backend" "restic/debug" diff --git a/src/restic/backend/test/tests_test.go b/src/restic/backend/test/tests_test.go index 1674f1f5..5dbba88a 100644 --- a/src/restic/backend/test/tests_test.go +++ b/src/restic/backend/test/tests_test.go @@ -1,7 +1,7 @@ package test_test import ( - "errors" + "github.com/pkg/errors" "restic/backend" "restic/backend/mem" diff --git a/src/restic/cache.go b/src/restic/cache.go index e4b8507c..1060c0a4 100644 --- a/src/restic/cache.go +++ b/src/restic/cache.go @@ -1,7 +1,6 @@ package restic import ( - "errors" "fmt" "io" "os" @@ -9,6 +8,8 @@ import ( "runtime" "strings" + "github.com/pkg/errors" + "restic/backend" "restic/debug" "restic/fs" diff --git a/src/restic/checker/checker.go b/src/restic/checker/checker.go index fc15b35f..9a3a518d 100644 --- a/src/restic/checker/checker.go +++ b/src/restic/checker/checker.go @@ -6,6 +6,8 @@ import ( "fmt" "sync" + "github.com/pkg/errors" + "restic" "restic/backend" "restic/crypto" diff --git a/src/restic/crypto/crypto.go b/src/restic/crypto/crypto.go index 17cfa309..71bf8c15 100644 --- a/src/restic/crypto/crypto.go +++ b/src/restic/crypto/crypto.go @@ -5,9 +5,10 @@ import ( "crypto/cipher" "crypto/rand" "encoding/json" - "errors" "fmt" + "github.com/pkg/errors" + "golang.org/x/crypto/poly1305" ) diff --git a/src/restic/filter/filter.go b/src/restic/filter/filter.go index 7105a76a..ccef3a6f 100644 --- a/src/restic/filter/filter.go +++ b/src/restic/filter/filter.go @@ -1,9 +1,10 @@ package filter import ( - "errors" "path/filepath" "strings" + + "github.com/pkg/errors" ) // ErrBadString is returned when Match is called with the empty string as the diff --git a/src/restic/fuse/file.go b/src/restic/fuse/file.go index ef6766d9..f6dfa771 100644 --- a/src/restic/fuse/file.go +++ b/src/restic/fuse/file.go @@ -4,9 +4,10 @@ package fuse import ( - "errors" "sync" + "github.com/pkg/errors" + "restic" "restic/backend" "restic/debug" diff --git a/src/restic/fuse/file_test.go b/src/restic/fuse/file_test.go index 12bcb859..cb1c6745 100644 --- a/src/restic/fuse/file_test.go +++ b/src/restic/fuse/file_test.go @@ -5,11 +5,12 @@ package fuse import ( "bytes" - "errors" "math/rand" "testing" "time" + "github.com/pkg/errors" + "bazil.org/fuse" "restic" diff --git a/src/restic/fuse/link.go b/src/restic/fuse/link.go index 1cf02df0..732446a7 100644 --- a/src/restic/fuse/link.go +++ b/src/restic/fuse/link.go @@ -4,11 +4,12 @@ package fuse import ( + "restic" + "restic/repository" + "bazil.org/fuse" "bazil.org/fuse/fs" "golang.org/x/net/context" - "restic" - "restic/repository" ) // Statically ensure that *file implements the given interface diff --git a/src/restic/index/index.go b/src/restic/index/index.go index 0d2d7039..e2fa2e21 100644 --- a/src/restic/index/index.go +++ b/src/restic/index/index.go @@ -2,7 +2,6 @@ package index import ( - "errors" "fmt" "os" "restic" @@ -12,6 +11,8 @@ import ( "restic/pack" "restic/types" "restic/worker" + + "github.com/pkg/errors" ) // Pack contains information about the contents of a pack. diff --git a/src/restic/node_windows.go b/src/restic/node_windows.go index c238cf87..08a7f86a 100644 --- a/src/restic/node_windows.go +++ b/src/restic/node_windows.go @@ -1,8 +1,9 @@ package restic import ( - "errors" "syscall" + + "github.com/pkg/errors" ) // mknod() creates a filesystem node (file, device diff --git a/src/restic/pack/pack.go b/src/restic/pack/pack.go index 4ffbf4d7..d2908182 100644 --- a/src/restic/pack/pack.go +++ b/src/restic/pack/pack.go @@ -3,11 +3,12 @@ package pack import ( "bytes" "encoding/binary" - "errors" "fmt" "io" "sync" + "github.com/pkg/errors" + "restic/backend" "restic/crypto" ) diff --git a/src/restic/pipe/pipe.go b/src/restic/pipe/pipe.go index 92343f54..78562f0f 100644 --- a/src/restic/pipe/pipe.go +++ b/src/restic/pipe/pipe.go @@ -1,12 +1,13 @@ package pipe import ( - "errors" "fmt" "os" "path/filepath" "sort" + "github.com/pkg/errors" + "restic/debug" "restic/fs" ) diff --git a/src/restic/repository/config.go b/src/restic/repository/config.go index 46f739d3..df7fd2b7 100644 --- a/src/restic/repository/config.go +++ b/src/restic/repository/config.go @@ -4,10 +4,11 @@ import ( "crypto/rand" "crypto/sha256" "encoding/hex" - "errors" "io" "testing" + "github.com/pkg/errors" + "restic/backend" "restic/debug" diff --git a/src/restic/repository/index.go b/src/restic/repository/index.go index 86968ba1..bdf70c35 100644 --- a/src/restic/repository/index.go +++ b/src/restic/repository/index.go @@ -3,12 +3,13 @@ package repository import ( "bytes" "encoding/json" - "errors" "fmt" "io" "sync" "time" + "github.com/pkg/errors" + "restic/backend" "restic/crypto" "restic/debug" diff --git a/src/restic/repository/key.go b/src/restic/repository/key.go index 2599f6e2..3ef78e6b 100644 --- a/src/restic/repository/key.go +++ b/src/restic/repository/key.go @@ -2,12 +2,13 @@ package repository import ( "encoding/json" - "errors" "fmt" "os" "os/user" "time" + "github.com/pkg/errors" + "restic/backend" "restic/crypto" "restic/debug" diff --git a/src/restic/repository/parallel_test.go b/src/restic/repository/parallel_test.go index dfcce0a1..6aab24b0 100644 --- a/src/restic/repository/parallel_test.go +++ b/src/restic/repository/parallel_test.go @@ -1,11 +1,12 @@ package repository_test import ( - "errors" "math/rand" "testing" "time" + "github.com/pkg/errors" + "restic/backend" "restic/repository" . "restic/test" diff --git a/src/restic/repository/repository.go b/src/restic/repository/repository.go index 8949b813..eaa7e530 100644 --- a/src/restic/repository/repository.go +++ b/src/restic/repository/repository.go @@ -3,11 +3,12 @@ package repository import ( "bytes" "encoding/json" - "errors" "fmt" "io" "os" + "github.com/pkg/errors" + "restic/backend" "restic/crypto" "restic/debug" diff --git a/src/restic/snapshot.go b/src/restic/snapshot.go index 3eaa0b61..0b2374d6 100644 --- a/src/restic/snapshot.go +++ b/src/restic/snapshot.go @@ -1,13 +1,14 @@ package restic import ( - "errors" "fmt" "os" "os/user" "path/filepath" "time" + "github.com/pkg/errors" + "restic/backend" "restic/repository" ) diff --git a/src/restic/tree.go b/src/restic/tree.go index 067dc6b7..9bfcfd7e 100644 --- a/src/restic/tree.go +++ b/src/restic/tree.go @@ -1,10 +1,11 @@ package restic import ( - "errors" "fmt" "sort" + "github.com/pkg/errors" + "restic/backend" "restic/debug" "restic/pack" diff --git a/src/restic/worker/pool_test.go b/src/restic/worker/pool_test.go index f7066441..329ce9a8 100644 --- a/src/restic/worker/pool_test.go +++ b/src/restic/worker/pool_test.go @@ -1,9 +1,10 @@ package worker_test import ( - "errors" "testing" + "github.com/pkg/errors" + "restic/worker" )