diff --git a/cmd/restic/background_linux.go b/cmd/restic/background_linux.go index 285a0e88a..b9a2a2f00 100644 --- a/cmd/restic/background_linux.go +++ b/cmd/restic/background_linux.go @@ -4,7 +4,7 @@ import ( "syscall" "unsafe" - "restic/debug" + "github.com/restic/restic/internal/debug" ) // IsProcessBackground returns true if it is running in the background or false if not diff --git a/cmd/restic/cleanup.go b/cmd/restic/cleanup.go index 8e35e3345..12dbdc142 100644 --- a/cmd/restic/cleanup.go +++ b/cmd/restic/cleanup.go @@ -7,7 +7,7 @@ import ( "sync" "syscall" - "restic/debug" + "github.com/restic/restic/internal/debug" ) var cleanupHandlers struct { diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 773645693..1e65e8fd3 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -7,17 +7,18 @@ import ( "io" "os" "path/filepath" - "restic" "strings" "time" + "github.com/restic/restic/internal" + "github.com/spf13/cobra" - "restic/archiver" - "restic/debug" - "restic/errors" - "restic/filter" - "restic/fs" + "github.com/restic/restic/internal/archiver" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/filter" + "github.com/restic/restic/internal/fs" ) var cmdBackup = &cobra.Command{ diff --git a/cmd/restic/cmd_cat.go b/cmd/restic/cmd_cat.go index 565cccbbe..42933d16b 100644 --- a/cmd/restic/cmd_cat.go +++ b/cmd/restic/cmd_cat.go @@ -8,10 +8,10 @@ import ( "github.com/spf13/cobra" - "restic" - "restic/backend" - "restic/errors" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/backend" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/repository" ) var cmdCat = &cobra.Command{ diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 985542d6e..d547b6ed9 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/cobra" - "restic" - "restic/checker" - "restic/errors" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/checker" + "github.com/restic/restic/internal/errors" ) var cmdCheck = &cobra.Command{ diff --git a/cmd/restic/cmd_dump.go b/cmd/restic/cmd_dump.go index 86fd8e93e..2b11d6a8a 100644 --- a/cmd/restic/cmd_dump.go +++ b/cmd/restic/cmd_dump.go @@ -11,12 +11,12 @@ import ( "github.com/spf13/cobra" - "restic" - "restic/errors" - "restic/pack" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/pack" + "github.com/restic/restic/internal/repository" - "restic/worker" + "github.com/restic/restic/internal/worker" ) var cmdDump = &cobra.Command{ diff --git a/cmd/restic/cmd_find.go b/cmd/restic/cmd_find.go index 3d98c3f8a..d278f7238 100644 --- a/cmd/restic/cmd_find.go +++ b/cmd/restic/cmd_find.go @@ -9,9 +9,9 @@ import ( "github.com/spf13/cobra" - "restic" - "restic/debug" - "restic/errors" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" ) var cmdFind = &cobra.Command{ diff --git a/cmd/restic/cmd_forget.go b/cmd/restic/cmd_forget.go index 26388eaa8..1c70929ea 100644 --- a/cmd/restic/cmd_forget.go +++ b/cmd/restic/cmd_forget.go @@ -3,10 +3,11 @@ package main import ( "context" "encoding/json" - "restic" "sort" "strings" + "github.com/restic/restic/internal" + "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_init.go b/cmd/restic/cmd_init.go index 69cacc6ca..47bbf4812 100644 --- a/cmd/restic/cmd_init.go +++ b/cmd/restic/cmd_init.go @@ -2,8 +2,9 @@ package main import ( "context" - "restic/errors" - "restic/repository" + + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/repository" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_key.go b/cmd/restic/cmd_key.go index 864c520e6..af8f53d78 100644 --- a/cmd/restic/cmd_key.go +++ b/cmd/restic/cmd_key.go @@ -3,9 +3,10 @@ package main import ( "context" "fmt" - "restic" - "restic/errors" - "restic/repository" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/repository" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_list.go b/cmd/restic/cmd_list.go index dd4ee8053..4e8ea6821 100644 --- a/cmd/restic/cmd_list.go +++ b/cmd/restic/cmd_list.go @@ -3,9 +3,10 @@ package main import ( "context" "fmt" - "restic" - "restic/errors" - "restic/index" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/index" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_ls.go b/cmd/restic/cmd_ls.go index 83acd5b27..33bba2ba9 100644 --- a/cmd/restic/cmd_ls.go +++ b/cmd/restic/cmd_ls.go @@ -6,9 +6,9 @@ import ( "github.com/spf13/cobra" - "restic" - "restic/errors" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/repository" ) var cmdLs = &cobra.Command{ diff --git a/cmd/restic/cmd_migrate.go b/cmd/restic/cmd_migrate.go index 8fb8b320b..bf95c535a 100644 --- a/cmd/restic/cmd_migrate.go +++ b/cmd/restic/cmd_migrate.go @@ -1,8 +1,8 @@ package main import ( - "restic" - "restic/migrations" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/migrations" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index b7872eef8..6337f4f6f 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -6,15 +6,16 @@ package main import ( "context" "os" - "restic" + + "github.com/restic/restic/internal" "github.com/spf13/cobra" - "restic/debug" - "restic/errors" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" - resticfs "restic/fs" - "restic/fuse" + resticfs "github.com/restic/restic/internal/fs" + "github.com/restic/restic/internal/fuse" systemFuse "bazil.org/fuse" "bazil.org/fuse/fs" diff --git a/cmd/restic/cmd_options.go b/cmd/restic/cmd_options.go index ba78941b0..be19ea76b 100644 --- a/cmd/restic/cmd_options.go +++ b/cmd/restic/cmd_options.go @@ -2,7 +2,8 @@ package main import ( "fmt" - "restic/options" + + "github.com/restic/restic/internal/options" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index aa7b9e76c..96dc4276a 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -2,13 +2,14 @@ package main import ( "fmt" - "restic" - "restic/debug" - "restic/errors" - "restic/index" - "restic/repository" "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" ) diff --git a/cmd/restic/cmd_rebuild_index.go b/cmd/restic/cmd_rebuild_index.go index 3e276d98d..4c086c862 100644 --- a/cmd/restic/cmd_rebuild_index.go +++ b/cmd/restic/cmd_rebuild_index.go @@ -2,8 +2,9 @@ package main import ( "context" - "restic" - "restic/index" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/index" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_restore.go b/cmd/restic/cmd_restore.go index f78f3010c..db92557ae 100644 --- a/cmd/restic/cmd_restore.go +++ b/cmd/restic/cmd_restore.go @@ -1,10 +1,10 @@ package main import ( - "restic" - "restic/debug" - "restic/errors" - "restic/filter" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/filter" "github.com/spf13/cobra" ) diff --git a/cmd/restic/cmd_snapshots.go b/cmd/restic/cmd_snapshots.go index 8a4c63c2e..d7f8f0657 100644 --- a/cmd/restic/cmd_snapshots.go +++ b/cmd/restic/cmd_snapshots.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" - "restic" + "github.com/restic/restic/internal" ) var cmdSnapshots = &cobra.Command{ diff --git a/cmd/restic/cmd_tag.go b/cmd/restic/cmd_tag.go index 014ade697..f67ce2a8c 100644 --- a/cmd/restic/cmd_tag.go +++ b/cmd/restic/cmd_tag.go @@ -5,10 +5,10 @@ import ( "github.com/spf13/cobra" - "restic" - "restic/debug" - "restic/errors" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/repository" ) var cmdTag = &cobra.Command{ diff --git a/cmd/restic/cmd_unlock.go b/cmd/restic/cmd_unlock.go index 33735d26a..1f8156c9e 100644 --- a/cmd/restic/cmd_unlock.go +++ b/cmd/restic/cmd_unlock.go @@ -2,7 +2,8 @@ package main import ( "context" - "restic" + + "github.com/restic/restic/internal" "github.com/spf13/cobra" ) diff --git a/cmd/restic/find.go b/cmd/restic/find.go index 4e4b63c59..25db96541 100644 --- a/cmd/restic/find.go +++ b/cmd/restic/find.go @@ -3,8 +3,8 @@ package main import ( "context" - "restic" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/repository" ) // FindFilteredSnapshots yields Snapshots, either given explicitly by `snapshotIDs` or filtered from the list of all snapshots. diff --git a/cmd/restic/format.go b/cmd/restic/format.go index 16c374699..835a6fed0 100644 --- a/cmd/restic/format.go +++ b/cmd/restic/format.go @@ -6,7 +6,7 @@ import ( "path/filepath" "time" - "restic" + "github.com/restic/restic/internal" ) func formatBytes(c uint64) string { diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 2a17379e8..c4e051f91 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -6,23 +6,24 @@ import ( "io" "io/ioutil" "os" - "restic" "runtime" "strings" "syscall" - "restic/backend/b2" - "restic/backend/local" - "restic/backend/location" - "restic/backend/rest" - "restic/backend/s3" - "restic/backend/sftp" - "restic/backend/swift" - "restic/debug" - "restic/options" - "restic/repository" + "github.com/restic/restic/internal" - "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" ) diff --git a/cmd/restic/global_debug.go b/cmd/restic/global_debug.go index 5c0ec75a6..1ba34f8b5 100644 --- a/cmd/restic/global_debug.go +++ b/cmd/restic/global_debug.go @@ -7,8 +7,9 @@ import ( "net/http" _ "net/http/pprof" "os" - "restic/errors" - "restic/repository" + + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/repository" "github.com/pkg/profile" ) diff --git a/cmd/restic/integration_fuse_test.go b/cmd/restic/integration_fuse_test.go index d3cb03439..323a8a447 100644 --- a/cmd/restic/integration_fuse_test.go +++ b/cmd/restic/integration_fuse_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" - "restic" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) const ( diff --git a/cmd/restic/integration_helpers_test.go b/cmd/restic/integration_helpers_test.go index 8c58028f6..2c6507601 100644 --- a/cmd/restic/integration_helpers_test.go +++ b/cmd/restic/integration_helpers_test.go @@ -9,9 +9,9 @@ import ( "runtime" "testing" - "restic/options" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal/options" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) type dirEntry struct { diff --git a/cmd/restic/integration_test.go b/cmd/restic/integration_test.go index 2ee21a506..73e5bb409 100644 --- a/cmd/restic/integration_test.go +++ b/cmd/restic/integration_test.go @@ -12,18 +12,19 @@ import ( "os" "path/filepath" "regexp" - "restic" "strings" "syscall" "testing" "time" - "restic/errors" + "github.com/restic/restic/internal" - "restic/debug" - "restic/filter" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/debug" + "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 { diff --git a/cmd/restic/local_layout_test.go b/cmd/restic/local_layout_test.go index fbb1f13af..264ef997e 100644 --- a/cmd/restic/local_layout_test.go +++ b/cmd/restic/local_layout_test.go @@ -2,8 +2,9 @@ package main import ( "path/filepath" - . "restic/test" "testing" + + . "github.com/restic/restic/internal/test" ) func TestRestoreLocalLayout(t *testing.T) { diff --git a/cmd/restic/lock.go b/cmd/restic/lock.go index 647233b9a..08ce0ce73 100644 --- a/cmd/restic/lock.go +++ b/cmd/restic/lock.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "restic" - "restic/debug" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/repository" ) var globalLocks struct { diff --git a/cmd/restic/main.go b/cmd/restic/main.go index f8439e30d..06af4877c 100644 --- a/cmd/restic/main.go +++ b/cmd/restic/main.go @@ -6,14 +6,15 @@ import ( "fmt" "log" "os" - "restic" - "restic/debug" - "restic/options" "runtime" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/options" + "github.com/spf13/cobra" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // cmdRoot is the base command when no other command has been specified. diff --git a/internal/archiver/archive_reader.go b/internal/archiver/archive_reader.go index d67130744..ced4a2540 100644 --- a/internal/archiver/archive_reader.go +++ b/internal/archiver/archive_reader.go @@ -3,11 +3,12 @@ package archiver import ( "context" "io" - "restic" - "restic/debug" "time" - "restic/errors" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + + "github.com/restic/restic/internal/errors" "github.com/restic/chunker" ) diff --git a/internal/archiver/archive_reader_test.go b/internal/archiver/archive_reader_test.go index 03c644846..8db0aa64e 100644 --- a/internal/archiver/archive_reader_test.go +++ b/internal/archiver/archive_reader_test.go @@ -6,10 +6,11 @@ import ( "errors" "io" "math/rand" - "restic" - "restic/checker" - "restic/repository" "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 { diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index c1d4324a6..d3430aef2 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -7,17 +7,18 @@ import ( "io" "os" "path/filepath" - "restic" "sort" "sync" "time" - "restic/errors" - "restic/walk" + "github.com/restic/restic/internal" - "restic/debug" - "restic/fs" - "restic/pipe" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/walk" + + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/fs" + "github.com/restic/restic/internal/pipe" "github.com/restic/chunker" ) diff --git a/internal/archiver/archiver_duplication_test.go b/internal/archiver/archiver_duplication_test.go index 9c01d5035..bcc875529 100644 --- a/internal/archiver/archiver_duplication_test.go +++ b/internal/archiver/archiver_duplication_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic" - "restic/archiver" - "restic/mock" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/archiver" + "github.com/restic/restic/internal/mock" + "github.com/restic/restic/internal/repository" ) const parallelSaves = 50 diff --git a/internal/archiver/archiver_int_test.go b/internal/archiver/archiver_int_test.go index eb135436e..b1273fee9 100644 --- a/internal/archiver/archiver_int_test.go +++ b/internal/archiver/archiver_int_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - "restic/pipe" - "restic/walk" + "github.com/restic/restic/internal/pipe" + "github.com/restic/restic/internal/walk" ) var treeJobs = []string{ diff --git a/internal/archiver/archiver_test.go b/internal/archiver/archiver_test.go index 236027d6b..082b0ca26 100644 --- a/internal/archiver/archiver_test.go +++ b/internal/archiver/archiver_test.go @@ -7,14 +7,14 @@ import ( "testing" "time" - "restic" - "restic/archiver" - "restic/checker" - "restic/crypto" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/archiver" + "github.com/restic/restic/internal/checker" + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" - "restic/errors" + "github.com/restic/restic/internal/errors" "github.com/restic/chunker" ) diff --git a/internal/archiver/testing.go b/internal/archiver/testing.go index 40af1ec57..b5ea08b0c 100644 --- a/internal/archiver/testing.go +++ b/internal/archiver/testing.go @@ -2,8 +2,9 @@ package archiver import ( "context" - "restic" "testing" + + "github.com/restic/restic/internal" ) // TestSnapshot creates a new snapshot of path. diff --git a/internal/backend/b2/b2.go b/internal/backend/b2/b2.go index 69ccb9bdc..a67881ecd 100644 --- a/internal/backend/b2/b2.go +++ b/internal/backend/b2/b2.go @@ -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" ) diff --git a/internal/backend/b2/b2_test.go b/internal/backend/b2/b2_test.go index d9828fa78..7707d2aa3 100644 --- a/internal/backend/b2/b2_test.go +++ b/internal/backend/b2/b2_test.go @@ -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 { diff --git a/internal/backend/b2/config.go b/internal/backend/b2/config.go index 922605636..f10e4d10d 100644 --- a/internal/backend/b2/config.go +++ b/internal/backend/b2/config.go @@ -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 diff --git a/internal/backend/http_transport.go b/internal/backend/http_transport.go index 6d7bef7e6..f3034f794 100644 --- a/internal/backend/http_transport.go +++ b/internal/backend/http_transport.go @@ -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. diff --git a/internal/backend/layout.go b/internal/backend/layout.go index b58f290be..dfe413576 100644 --- a/internal/backend/layout.go +++ b/internal/backend/layout.go @@ -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. diff --git a/internal/backend/layout_default.go b/internal/backend/layout_default.go index daedb610d..3d9ba5e65 100644 --- a/internal/backend/layout_default.go +++ b/internal/backend/layout_default.go @@ -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 diff --git a/internal/backend/layout_rest.go b/internal/backend/layout_rest.go index 007be37c8..dd903913d 100644 --- a/internal/backend/layout_rest.go +++ b/internal/backend/layout_rest.go @@ -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 { diff --git a/internal/backend/layout_s3legacy.go b/internal/backend/layout_s3legacy.go index d9d7ab212..5d759d893 100644 --- a/internal/backend/layout_s3legacy.go +++ b/internal/backend/layout_s3legacy.go @@ -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. diff --git a/internal/backend/layout_test.go b/internal/backend/layout_test.go index ff6378299..d5fd3e9e7 100644 --- a/internal/backend/layout_test.go +++ b/internal/backend/layout_test.go @@ -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) { diff --git a/internal/backend/local/config.go b/internal/backend/local/config.go index e693d8c9e..13b7f67aa 100644 --- a/internal/backend/local/config.go +++ b/internal/backend/local/config.go @@ -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. diff --git a/internal/backend/local/layout_test.go b/internal/backend/local/layout_test.go index 3f009b49d..23b3b0702 100644 --- a/internal/backend/local/layout_test.go +++ b/internal/backend/local/layout_test.go @@ -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) { diff --git a/internal/backend/local/local.go b/internal/backend/local/local.go index fef16f704..34d1d3441 100644 --- a/internal/backend/local/local.go +++ b/internal/backend/local/local.go @@ -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. diff --git a/internal/backend/local/local_test.go b/internal/backend/local/local_test.go index d2bed6e13..b032f9f90 100644 --- a/internal/backend/local/local_test.go +++ b/internal/backend/local/local_test.go @@ -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 { diff --git a/internal/backend/local/local_unix.go b/internal/backend/local/local_unix.go index 2f0826d79..5705960a2 100644 --- a/internal/backend/local/local_unix.go +++ b/internal/backend/local/local_unix.go @@ -4,7 +4,8 @@ package local import ( "os" - "restic/fs" + + "github.com/restic/restic/internal/fs" ) // set file to readonly diff --git a/internal/backend/location/location.go b/internal/backend/location/location.go index a5a070b12..0466325a7 100644 --- a/internal/backend/location/location.go +++ b/internal/backend/location/location.go @@ -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 diff --git a/internal/backend/location/location_test.go b/internal/backend/location/location_test.go index 9616d2ad5..f8d05ca78 100644 --- a/internal/backend/location/location_test.go +++ b/internal/backend/location/location_test.go @@ -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 { diff --git a/internal/backend/mem/mem_backend.go b/internal/backend/mem/mem_backend.go index abd68fcf6..4e5e92a84 100644 --- a/internal/backend/mem/mem_backend.go +++ b/internal/backend/mem/mem_backend.go @@ -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 diff --git a/internal/backend/mem/mem_backend_test.go b/internal/backend/mem/mem_backend_test.go index 422920da1..91741f3ea 100644 --- a/internal/backend/mem/mem_backend_test.go +++ b/internal/backend/mem/mem_backend_test.go @@ -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 { diff --git a/internal/backend/rest/config.go b/internal/backend/rest/config.go index f696d17de..34d7958fb 100644 --- a/internal/backend/rest/config.go +++ b/internal/backend/rest/config.go @@ -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. diff --git a/internal/backend/rest/rest.go b/internal/backend/rest/rest.go index e7976d244..a8d1a7f17 100644 --- a/internal/backend/rest/rest.go +++ b/internal/backend/rest/rest.go @@ -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 diff --git a/internal/backend/rest/rest_test.go b/internal/backend/rest/rest_test.go index d8a7afbe3..b5e0dd39b 100644 --- a/internal/backend/rest/rest_test.go +++ b/internal/backend/rest/rest_test.go @@ -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() { diff --git a/internal/backend/s3/config.go b/internal/backend/s3/config.go index 673b1aaad..59cdec254 100644 --- a/internal/backend/s3/config.go +++ b/internal/backend/s3/config.go @@ -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 diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index cdfe37056..6017c1736 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -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. diff --git a/internal/backend/s3/s3_test.go b/internal/backend/s3/s3_test.go index 72600061e..a1c522bb9 100644 --- a/internal/backend/s3/s3_test.go +++ b/internal/backend/s3/s3_test.go @@ -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) { diff --git a/internal/backend/semaphore.go b/internal/backend/semaphore.go index 4bb1ad3ab..e83191c46 100644 --- a/internal/backend/semaphore.go +++ b/internal/backend/semaphore.go @@ -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 { diff --git a/internal/backend/sftp/config.go b/internal/backend/sftp/config.go index 1ba3dcbbd..708150206 100644 --- a/internal/backend/sftp/config.go +++ b/internal/backend/sftp/config.go @@ -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. diff --git a/internal/backend/sftp/layout_test.go b/internal/backend/sftp/layout_test.go index aa030ee05..f993fe5bd 100644 --- a/internal/backend/sftp/layout_test.go +++ b/internal/backend/sftp/layout_test.go @@ -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) { diff --git a/internal/backend/sftp/sftp.go b/internal/backend/sftp/sftp.go index 3d4203162..d646b5b29 100644 --- a/internal/backend/sftp/sftp.go +++ b/internal/backend/sftp/sftp.go @@ -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" ) diff --git a/internal/backend/sftp/sftp_test.go b/internal/backend/sftp/sftp_test.go index 8f52b57a5..c2f5f84e5 100644 --- a/internal/backend/sftp/sftp_test.go +++ b/internal/backend/sftp/sftp_test.go @@ -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 { diff --git a/internal/backend/sftp/split.go b/internal/backend/sftp/split.go index dd6f68db9..d429f7e35 100644 --- a/internal/backend/sftp/split.go +++ b/internal/backend/sftp/split.go @@ -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 diff --git a/internal/backend/swift/config.go b/internal/backend/swift/config.go index 255c28fd8..9c152707e 100644 --- a/internal/backend/swift/config.go +++ b/internal/backend/swift/config.go @@ -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 diff --git a/internal/backend/swift/swift.go b/internal/backend/swift/swift.go index ef9276d15..a149e2b85 100644 --- a/internal/backend/swift/swift.go +++ b/internal/backend/swift/swift.go @@ -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" ) diff --git a/internal/backend/swift/swift_test.go b/internal/backend/swift/swift_test.go index c2d1cc14b..cfe1ece85 100644 --- a/internal/backend/swift/swift_test.go +++ b/internal/backend/swift/swift_test.go @@ -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 { diff --git a/internal/backend/test/benchmarks.go b/internal/backend/test/benchmarks.go index fb7106561..3b492390f 100644 --- a/internal/backend/test/benchmarks.go +++ b/internal/backend/test/benchmarks.go @@ -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) { diff --git a/internal/backend/test/suite.go b/internal/backend/test/suite.go index 5fecc73f4..a31f08fe2 100644 --- a/internal/backend/test/suite.go +++ b/internal/backend/test/suite.go @@ -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. diff --git a/internal/backend/test/tests.go b/internal/backend/test/tests.go index 504f65097..a4a9c53ed 100644 --- a/internal/backend/test/tests.go +++ b/internal/backend/test/tests.go @@ -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) { diff --git a/internal/backend/test/tests_test.go b/internal/backend/test/tests_test.go index d662e5a32..d28f54402 100644 --- a/internal/backend/test/tests_test.go +++ b/internal/backend/test/tests_test.go @@ -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 diff --git a/internal/backend/utils.go b/internal/backend/utils.go index 76e9de569..3ce011115 100644 --- a/internal/backend/utils.go +++ b/internal/backend/utils.go @@ -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. diff --git a/internal/backend/utils_test.go b/internal/backend/utils_test.go index 15829f46e..c2d9e2f33 100644 --- a/internal/backend/utils_test.go +++ b/internal/backend/utils_test.go @@ -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 diff --git a/internal/backend_find.go b/internal/backend_find.go index e445972c9..02521a25d 100644 --- a/internal/backend_find.go +++ b/internal/backend_find.go @@ -2,7 +2,8 @@ package restic import ( "context" - "restic/errors" + + "github.com/restic/restic/internal/errors" ) // ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix diff --git a/internal/blob.go b/internal/blob.go index 35887121c..f8f0737e3 100644 --- a/internal/blob.go +++ b/internal/blob.go @@ -3,7 +3,7 @@ package restic import ( "fmt" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // Blob is one part of a file or a tree. diff --git a/internal/buffer.go b/internal/buffer.go index d822fced9..899f4ea6f 100644 --- a/internal/buffer.go +++ b/internal/buffer.go @@ -1,6 +1,6 @@ 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 // plaintext bytes, including the crypto overhead. diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 70320467a..e11b846e8 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -8,14 +8,14 @@ import ( "os" "sync" - "restic/errors" - "restic/fs" - "restic/hashing" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/fs" + "github.com/restic/restic/internal/hashing" - "restic" - "restic/debug" - "restic/pack" - "restic/repository" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/pack" + "github.com/restic/restic/internal/repository" ) // Checker runs various checks on a repository. It is advisable to create an diff --git a/internal/checker/checker_test.go b/internal/checker/checker_test.go index ee345a97b..3e247bfee 100644 --- a/internal/checker/checker_test.go +++ b/internal/checker/checker_test.go @@ -8,11 +8,11 @@ import ( "sort" "testing" - "restic" - "restic/archiver" - "restic/checker" - "restic/repository" - "restic/test" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/archiver" + "github.com/restic/restic/internal/checker" + "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/test" ) var checkerTestData = filepath.Join("testdata", "checker-test-repo.tar.gz") diff --git a/internal/checker/testing.go b/internal/checker/testing.go index 26a213f39..5e34ddb5f 100644 --- a/internal/checker/testing.go +++ b/internal/checker/testing.go @@ -2,8 +2,9 @@ package checker import ( "context" - "restic" "testing" + + "github.com/restic/restic/internal" ) // TestCheckRepo runs the checker on repo. diff --git a/internal/config.go b/internal/config.go index dbd6fd9cf..a11bf5409 100644 --- a/internal/config.go +++ b/internal/config.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/debug" + "github.com/restic/restic/internal/debug" "github.com/restic/chunker" ) diff --git a/internal/config_test.go b/internal/config_test.go index c287ae196..dcb46619f 100644 --- a/internal/config_test.go +++ b/internal/config_test.go @@ -2,10 +2,11 @@ package restic_test import ( "context" - "restic" "testing" - . "restic/test" + "github.com/restic/restic/internal" + + . "github.com/restic/restic/internal/test" ) type saver func(restic.FileType, interface{}) (restic.ID, error) diff --git a/internal/crypto/crypto.go b/internal/crypto/crypto.go index 68e5c6b3a..1b8808d44 100644 --- a/internal/crypto/crypto.go +++ b/internal/crypto/crypto.go @@ -7,7 +7,7 @@ import ( "encoding/json" "fmt" - "restic/errors" + "github.com/restic/restic/internal/errors" "golang.org/x/crypto/poly1305" ) diff --git a/internal/crypto/crypto_test.go b/internal/crypto/crypto_test.go index 4ebc7a0d8..b9d3d4bca 100644 --- a/internal/crypto/crypto_test.go +++ b/internal/crypto/crypto_test.go @@ -6,8 +6,8 @@ import ( "io" "testing" - "restic/crypto" - . "restic/test" + "github.com/restic/restic/internal/crypto" + . "github.com/restic/restic/internal/test" "github.com/restic/chunker" ) diff --git a/internal/crypto/kdf.go b/internal/crypto/kdf.go index 4b863037b..a0d98e748 100644 --- a/internal/crypto/kdf.go +++ b/internal/crypto/kdf.go @@ -4,7 +4,7 @@ import ( "crypto/rand" "time" - "restic/errors" + "github.com/restic/restic/internal/errors" sscrypt "github.com/elithrar/simple-scrypt" "golang.org/x/crypto/scrypt" diff --git a/internal/debug/debug.go b/internal/debug/debug.go index 2d82188ea..b0c4ea4e4 100644 --- a/internal/debug/debug.go +++ b/internal/debug/debug.go @@ -8,11 +8,12 @@ import ( "os" "path" "path/filepath" - "restic/fs" "runtime" "strings" - "restic/errors" + "github.com/restic/restic/internal/fs" + + "github.com/restic/restic/internal/errors" ) var opts struct { diff --git a/internal/debug/round_tripper_debug.go b/internal/debug/round_tripper_debug.go index 523d8438d..7b29267c9 100644 --- a/internal/debug/round_tripper_debug.go +++ b/internal/debug/round_tripper_debug.go @@ -9,7 +9,8 @@ import ( "net/http" "net/http/httputil" "os" - "restic/errors" + + "github.com/restic/restic/internal/errors" ) type eofDetectRoundTripper struct { diff --git a/internal/file.go b/internal/file.go index bfe44ad42..71b56d657 100644 --- a/internal/file.go +++ b/internal/file.go @@ -3,7 +3,7 @@ package restic import ( "fmt" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // FileType is the type of a file in the backend. diff --git a/internal/filter/filter.go b/internal/filter/filter.go index 37b58f7ef..8ed8d1ef7 100644 --- a/internal/filter/filter.go +++ b/internal/filter/filter.go @@ -4,7 +4,7 @@ import ( "path/filepath" "strings" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // ErrBadString is returned when Match is called with the empty string as the diff --git a/internal/filter/filter_test.go b/internal/filter/filter_test.go index 78cb3ec5b..26d2a272c 100644 --- a/internal/filter/filter_test.go +++ b/internal/filter/filter_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "restic/filter" + "github.com/restic/restic/internal/filter" ) var matchTests = []struct { diff --git a/internal/find_test.go b/internal/find_test.go index 272472ffa..8575da910 100644 --- a/internal/find_test.go +++ b/internal/find_test.go @@ -8,12 +8,13 @@ import ( "fmt" "os" "path/filepath" - "restic" "sort" "testing" "time" - "restic/repository" + "github.com/restic/restic/internal" + + "github.com/restic/restic/internal/repository" ) func loadIDSet(t testing.TB, filename string) restic.BlobSet { diff --git a/internal/fs/deviceid_unix.go b/internal/fs/deviceid_unix.go index 40069d3e5..31efd29ff 100644 --- a/internal/fs/deviceid_unix.go +++ b/internal/fs/deviceid_unix.go @@ -6,7 +6,7 @@ import ( "os" "syscall" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // DeviceID extracts the device ID from an os.FileInfo object by casting it diff --git a/internal/fs/deviceid_windows.go b/internal/fs/deviceid_windows.go index fd86f5daf..4e2f2f9de 100644 --- a/internal/fs/deviceid_windows.go +++ b/internal/fs/deviceid_windows.go @@ -5,7 +5,7 @@ package fs import ( "os" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // DeviceID extracts the device ID from an os.FileInfo object by casting it diff --git a/internal/fuse/blob_size_cache.go b/internal/fuse/blob_size_cache.go index e12c171de..2eee45069 100644 --- a/internal/fuse/blob_size_cache.go +++ b/internal/fuse/blob_size_cache.go @@ -4,7 +4,7 @@ package fuse import ( - "restic" + "github.com/restic/restic/internal" "golang.org/x/net/context" ) diff --git a/internal/fuse/dir.go b/internal/fuse/dir.go index 97effbf42..424ff3d3a 100644 --- a/internal/fuse/dir.go +++ b/internal/fuse/dir.go @@ -10,8 +10,8 @@ import ( "bazil.org/fuse/fs" "golang.org/x/net/context" - "restic" - "restic/debug" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" ) // Statically ensure that *dir implement those interface diff --git a/internal/fuse/file.go b/internal/fuse/file.go index 00c14f4aa..449904276 100644 --- a/internal/fuse/file.go +++ b/internal/fuse/file.go @@ -4,10 +4,10 @@ package fuse import ( - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic" - "restic/debug" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" "bazil.org/fuse" "bazil.org/fuse/fs" diff --git a/internal/fuse/file_test.go b/internal/fuse/file_test.go index 46a33fc6a..f85844eac 100644 --- a/internal/fuse/file_test.go +++ b/internal/fuse/file_test.go @@ -11,13 +11,13 @@ import ( "golang.org/x/net/context" - "restic/repository" + "github.com/restic/restic/internal/repository" "bazil.org/fuse" "bazil.org/fuse/fs" - "restic" - . "restic/test" + "github.com/restic/restic/internal" + . "github.com/restic/restic/internal/test" ) func testRead(t testing.TB, f *file, offset, length int, data []byte) { diff --git a/internal/fuse/link.go b/internal/fuse/link.go index 53cc934a6..bc60634d6 100644 --- a/internal/fuse/link.go +++ b/internal/fuse/link.go @@ -4,7 +4,7 @@ package fuse import ( - "restic" + "github.com/restic/restic/internal" "bazil.org/fuse" "bazil.org/fuse/fs" diff --git a/internal/fuse/meta_dir.go b/internal/fuse/meta_dir.go index 8542b14c8..47afaf780 100644 --- a/internal/fuse/meta_dir.go +++ b/internal/fuse/meta_dir.go @@ -5,7 +5,8 @@ package fuse import ( "os" - "restic/debug" + + "github.com/restic/restic/internal/debug" "golang.org/x/net/context" diff --git a/internal/fuse/root.go b/internal/fuse/root.go index 613be0ff9..e2b1c5c21 100644 --- a/internal/fuse/root.go +++ b/internal/fuse/root.go @@ -4,8 +4,8 @@ package fuse import ( - "restic" - "restic/debug" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" "golang.org/x/net/context" diff --git a/internal/fuse/snapshots_dir.go b/internal/fuse/snapshots_dir.go index 44afd6bdb..2737f18b2 100644 --- a/internal/fuse/snapshots_dir.go +++ b/internal/fuse/snapshots_dir.go @@ -6,10 +6,11 @@ package fuse import ( "fmt" "os" - "restic" - "restic/debug" "time" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "golang.org/x/net/context" "bazil.org/fuse" diff --git a/internal/hardlinks_index_test.go b/internal/hardlinks_index_test.go index c0a675611..cf140003e 100644 --- a/internal/hardlinks_index_test.go +++ b/internal/hardlinks_index_test.go @@ -3,8 +3,8 @@ package restic_test import ( "testing" - "restic" - . "restic/test" + "github.com/restic/restic/internal" + . "github.com/restic/restic/internal/test" ) // TestHardLinks contains various tests for HardlinkIndex. diff --git a/internal/id.go b/internal/id.go index 25bf9514b..ffe818a83 100644 --- a/internal/id.go +++ b/internal/id.go @@ -7,7 +7,7 @@ import ( "encoding/json" "io" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // Hash returns the ID for data. diff --git a/internal/index/index.go b/internal/index/index.go index 81f0357cf..0c60a956c 100644 --- a/internal/index/index.go +++ b/internal/index/index.go @@ -5,13 +5,14 @@ import ( "context" "fmt" "os" - "restic" - "restic/debug" - "restic/list" - "restic/pack" - "restic/worker" - "restic/errors" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/list" + "github.com/restic/restic/internal/pack" + "github.com/restic/restic/internal/worker" + + "github.com/restic/restic/internal/errors" ) // Pack contains information about the contents of a pack. diff --git a/internal/index/index_test.go b/internal/index/index_test.go index ced5d2591..35c5eea12 100644 --- a/internal/index/index_test.go +++ b/internal/index/index_test.go @@ -3,12 +3,13 @@ package index import ( "context" "math/rand" - "restic" - "restic/checker" - "restic/repository" - "restic/test" "testing" "time" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/checker" + "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/test" ) var ( diff --git a/internal/list/list.go b/internal/list/list.go index 6bd9d23aa..6a979c669 100644 --- a/internal/list/list.go +++ b/internal/list/list.go @@ -2,8 +2,9 @@ package list import ( "context" - "restic" - "restic/worker" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/worker" ) const listPackWorkers = 10 diff --git a/internal/lock.go b/internal/lock.go index a036ec4b8..0a4146174 100644 --- a/internal/lock.go +++ b/internal/lock.go @@ -11,9 +11,9 @@ import ( "testing" "time" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/debug" + "github.com/restic/restic/internal/debug" ) // Lock represents a process locking the repository for an operation. diff --git a/internal/lock_test.go b/internal/lock_test.go index d5fd179a1..0e6223aff 100644 --- a/internal/lock_test.go +++ b/internal/lock_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "restic" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) func TestLock(t *testing.T) { diff --git a/internal/lock_unix.go b/internal/lock_unix.go index b81353a1f..019cbbfa5 100644 --- a/internal/lock_unix.go +++ b/internal/lock_unix.go @@ -8,9 +8,9 @@ import ( "strconv" "syscall" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/debug" + "github.com/restic/restic/internal/debug" ) // uidGidInt returns uid, gid of the user as a number. diff --git a/internal/lock_windows.go b/internal/lock_windows.go index 8cc9a71cb..5697b6efb 100644 --- a/internal/lock_windows.go +++ b/internal/lock_windows.go @@ -4,7 +4,7 @@ import ( "os" "os/user" - "restic/debug" + "github.com/restic/restic/internal/debug" ) // uidGidInt always returns 0 on Windows, since uid isn't numbers diff --git a/internal/migrations/interface.go b/internal/migrations/interface.go index 288ca273b..a679a3929 100644 --- a/internal/migrations/interface.go +++ b/internal/migrations/interface.go @@ -2,7 +2,8 @@ package migrations import ( "context" - "restic" + + "github.com/restic/restic/internal" ) // Migration implements a data migration. diff --git a/internal/migrations/s3_layout.go b/internal/migrations/s3_layout.go index 3ddb6ed3d..d54cd0e66 100644 --- a/internal/migrations/s3_layout.go +++ b/internal/migrations/s3_layout.go @@ -5,11 +5,12 @@ import ( "fmt" "os" "path" - "restic" - "restic/backend" - "restic/backend/s3" - "restic/debug" - "restic/errors" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/backend" + "github.com/restic/restic/internal/backend/s3" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" ) func init() { diff --git a/internal/mock/backend.go b/internal/mock/backend.go index ead50efcb..9c252778f 100644 --- a/internal/mock/backend.go +++ b/internal/mock/backend.go @@ -3,9 +3,10 @@ package mock import ( "context" "io" - "restic" - "restic/errors" + "github.com/restic/restic/internal" + + "github.com/restic/restic/internal/errors" ) // Backend implements a mock backend. diff --git a/internal/mock/repository.go b/internal/mock/repository.go index 3143a8ceb..5ecc563dc 100644 --- a/internal/mock/repository.go +++ b/internal/mock/repository.go @@ -1,8 +1,8 @@ package mock import ( - "restic" - "restic/crypto" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/crypto" ) // Repository implements a mock Repository. diff --git a/internal/node.go b/internal/node.go index 982b64472..9b3f5591b 100644 --- a/internal/node.go +++ b/internal/node.go @@ -11,12 +11,13 @@ import ( "syscall" "time" - "restic/errors" + "github.com/restic/restic/internal/errors" "bytes" - "restic/debug" - "restic/fs" "runtime" + + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/fs" ) // ExtendedAttribute is a tuple storing the xattr name and value. diff --git a/internal/node_linux.go b/internal/node_linux.go index 7ebad89f3..d33944672 100644 --- a/internal/node_linux.go +++ b/internal/node_linux.go @@ -6,9 +6,9 @@ import ( "golang.org/x/sys/unix" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/fs" + "github.com/restic/restic/internal/fs" ) func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespec) error { diff --git a/internal/node_test.go b/internal/node_test.go index f357adab2..542b753ca 100644 --- a/internal/node_test.go +++ b/internal/node_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "restic" - . "restic/test" + "github.com/restic/restic/internal" + . "github.com/restic/restic/internal/test" ) func BenchmarkNodeFillUser(t *testing.B) { diff --git a/internal/node_windows.go b/internal/node_windows.go index b75f1489f..c376cdef6 100644 --- a/internal/node_windows.go +++ b/internal/node_windows.go @@ -3,7 +3,7 @@ package restic import ( "syscall" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // mknod() creates a filesystem node (file, device diff --git a/internal/node_xattr.go b/internal/node_xattr.go index 2c117e029..c81cee691 100644 --- a/internal/node_xattr.go +++ b/internal/node_xattr.go @@ -4,9 +4,10 @@ package restic import ( - "restic/errors" "syscall" + "github.com/restic/restic/internal/errors" + "github.com/pkg/xattr" ) diff --git a/internal/options/options.go b/internal/options/options.go index 92e60cf03..2a3be2254 100644 --- a/internal/options/options.go +++ b/internal/options/options.go @@ -2,11 +2,12 @@ package options import ( "reflect" - "restic/errors" "sort" "strconv" "strings" "time" + + "github.com/restic/restic/internal/errors" ) // Options holds options in the form key=value. diff --git a/internal/pack/pack.go b/internal/pack/pack.go index fcf4f9908..46b0e68ff 100644 --- a/internal/pack/pack.go +++ b/internal/pack/pack.go @@ -5,13 +5,14 @@ import ( "encoding/binary" "fmt" "io" - "restic" "sync" - "restic/debug" - "restic/errors" + "github.com/restic/restic/internal" - "restic/crypto" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/crypto" ) // Packer is used to create a new Pack. diff --git a/internal/pack/pack_test.go b/internal/pack/pack_test.go index c16996158..882a6a75d 100644 --- a/internal/pack/pack_test.go +++ b/internal/pack/pack_test.go @@ -8,13 +8,14 @@ import ( "encoding/binary" "encoding/json" "io" - "restic" "testing" - "restic/backend/mem" - "restic/crypto" - "restic/pack" - . "restic/test" + "github.com/restic/restic/internal" + + "github.com/restic/restic/internal/backend/mem" + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/pack" + . "github.com/restic/restic/internal/test" ) var testLens = []int{23, 31650, 25860, 10928, 13769, 19862, 5211, 127, 13690, 30231} diff --git a/internal/pipe/pipe.go b/internal/pipe/pipe.go index 682bb5a2e..dfa140c0c 100644 --- a/internal/pipe/pipe.go +++ b/internal/pipe/pipe.go @@ -7,10 +7,10 @@ import ( "path/filepath" "sort" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/debug" - "restic/fs" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/fs" ) type Result interface{} diff --git a/internal/pipe/pipe_test.go b/internal/pipe/pipe_test.go index 197a1c428..377511b6c 100644 --- a/internal/pipe/pipe_test.go +++ b/internal/pipe/pipe_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "restic/debug" - "restic/pipe" - . "restic/test" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/pipe" + . "github.com/restic/restic/internal/test" ) type stats struct { diff --git a/internal/progress_unix.go b/internal/progress_unix.go index d93a491ca..b46b0ac79 100644 --- a/internal/progress_unix.go +++ b/internal/progress_unix.go @@ -7,7 +7,7 @@ import ( "os/signal" "syscall" - "restic/debug" + "github.com/restic/restic/internal/debug" ) func init() { diff --git a/internal/progress_unix_with_siginfo.go b/internal/progress_unix_with_siginfo.go index ffed4b89a..34caba690 100644 --- a/internal/progress_unix_with_siginfo.go +++ b/internal/progress_unix_with_siginfo.go @@ -7,7 +7,7 @@ import ( "os/signal" "syscall" - "restic/debug" + "github.com/restic/restic/internal/debug" ) func init() { diff --git a/internal/rand_reader.go b/internal/rand_reader.go index 205fd6aba..b5bc83839 100644 --- a/internal/rand_reader.go +++ b/internal/rand_reader.go @@ -4,7 +4,7 @@ import ( "io" "math/rand" - "restic/errors" + "github.com/restic/restic/internal/errors" ) // RandReader allows reading from a rand.Rand. diff --git a/internal/readerat.go b/internal/readerat.go index 69169e3d4..7b5a01fa6 100644 --- a/internal/readerat.go +++ b/internal/readerat.go @@ -3,7 +3,8 @@ package restic import ( "context" "io" - "restic/debug" + + "github.com/restic/restic/internal/debug" ) type backendReaderAt struct { diff --git a/internal/repository.go b/internal/repository.go index 302a55703..9be667fa7 100644 --- a/internal/repository.go +++ b/internal/repository.go @@ -2,7 +2,8 @@ package restic import ( "context" - "restic/crypto" + + "github.com/restic/restic/internal/crypto" ) // Repository stores data in a backend. It provides high-level functions and diff --git a/internal/repository/index.go b/internal/repository/index.go index dd96eec34..ff4adbe5c 100644 --- a/internal/repository/index.go +++ b/internal/repository/index.go @@ -4,13 +4,14 @@ import ( "context" "encoding/json" "io" - "restic" "sync" "time" - "restic/errors" + "github.com/restic/restic/internal" - "restic/debug" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/debug" ) // Index holds a lookup table for id -> pack. diff --git a/internal/repository/index_test.go b/internal/repository/index_test.go index b3f92931d..3736de3bc 100644 --- a/internal/repository/index_test.go +++ b/internal/repository/index_test.go @@ -2,11 +2,12 @@ package repository_test import ( "bytes" - "restic" "testing" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal" + + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) func TestIndexSerialize(t *testing.T) { diff --git a/internal/repository/key.go b/internal/repository/key.go index 827a1631e..3dc14099f 100644 --- a/internal/repository/key.go +++ b/internal/repository/key.go @@ -7,14 +7,15 @@ import ( "fmt" "os" "os/user" - "restic" "time" - "restic/errors" + "github.com/restic/restic/internal" - "restic/backend" - "restic/crypto" - "restic/debug" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/backend" + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/debug" ) var ( diff --git a/internal/repository/master_index.go b/internal/repository/master_index.go index 54d61f6db..b6ddb8bf5 100644 --- a/internal/repository/master_index.go +++ b/internal/repository/master_index.go @@ -2,12 +2,13 @@ package repository import ( "context" - "restic" "sync" - "restic/errors" + "github.com/restic/restic/internal" - "restic/debug" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/debug" ) // MasterIndex is a collection of indexes and IDs of chunks that are in the process of being saved. diff --git a/internal/repository/packer_manager.go b/internal/repository/packer_manager.go index dabb9743c..4d6087fba 100644 --- a/internal/repository/packer_manager.go +++ b/internal/repository/packer_manager.go @@ -5,16 +5,17 @@ import ( "crypto/sha256" "io" "os" - "restic" "sync" - "restic/errors" - "restic/hashing" + "github.com/restic/restic/internal" - "restic/crypto" - "restic/debug" - "restic/fs" - "restic/pack" + "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/hashing" + + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/fs" + "github.com/restic/restic/internal/pack" ) // Saver implements saving data in a backend. diff --git a/internal/repository/packer_manager_test.go b/internal/repository/packer_manager_test.go index 3b49655bd..fb7b94247 100644 --- a/internal/repository/packer_manager_test.go +++ b/internal/repository/packer_manager_test.go @@ -5,12 +5,13 @@ import ( "io" "math/rand" "os" - "restic" - "restic/backend/mem" - "restic/crypto" - "restic/fs" - "restic/mock" "testing" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/backend/mem" + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/fs" + "github.com/restic/restic/internal/mock" ) type randReader struct { diff --git a/internal/repository/parallel.go b/internal/repository/parallel.go index fa0c2032f..46f6880ae 100644 --- a/internal/repository/parallel.go +++ b/internal/repository/parallel.go @@ -2,10 +2,11 @@ package repository import ( "context" - "restic" "sync" - "restic/debug" + "github.com/restic/restic/internal" + + "github.com/restic/restic/internal/debug" ) // ParallelWorkFunc gets one file ID to work on. If an error is returned, diff --git a/internal/repository/parallel_test.go b/internal/repository/parallel_test.go index aa15e79e7..09ba2b01f 100644 --- a/internal/repository/parallel_test.go +++ b/internal/repository/parallel_test.go @@ -3,14 +3,15 @@ package repository_test import ( "context" "math/rand" - "restic" "testing" "time" - "restic/errors" + "github.com/restic/restic/internal" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) type testIDs []string diff --git a/internal/repository/repack.go b/internal/repository/repack.go index b010f2c7f..66a03ba00 100644 --- a/internal/repository/repack.go +++ b/internal/repository/repack.go @@ -4,13 +4,14 @@ import ( "context" "crypto/sha256" "io" - "restic" - "restic/debug" - "restic/fs" - "restic/hashing" - "restic/pack" - "restic/errors" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/fs" + "github.com/restic/restic/internal/hashing" + "github.com/restic/restic/internal/pack" + + "github.com/restic/restic/internal/errors" ) // Repack takes a list of packs together with a list of blobs contained in diff --git a/internal/repository/repack_test.go b/internal/repository/repack_test.go index 0a4d1f617..dbd8fad70 100644 --- a/internal/repository/repack_test.go +++ b/internal/repository/repack_test.go @@ -4,10 +4,11 @@ import ( "context" "io" "math/rand" - "restic" - "restic/index" - "restic/repository" "testing" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/index" + "github.com/restic/restic/internal/repository" ) func randomSize(min, max int) int { diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 8f037c917..5c1b8ce69 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -6,14 +6,15 @@ import ( "encoding/json" "fmt" "os" - "restic" - "restic/errors" + "github.com/restic/restic/internal" - "restic/backend" - "restic/crypto" - "restic/debug" - "restic/pack" + "github.com/restic/restic/internal/errors" + + "github.com/restic/restic/internal/backend" + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/pack" ) // Repository is used to access a repository in a backend. diff --git a/internal/repository/repository_test.go b/internal/repository/repository_test.go index 629716978..7939dd249 100644 --- a/internal/repository/repository_test.go +++ b/internal/repository/repository_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" - "restic" - "restic/archiver" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/archiver" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) var testSizes = []int{5, 23, 2<<18 + 23, 1 << 20} diff --git a/internal/repository/testing.go b/internal/repository/testing.go index ab78bdad3..8a98b679f 100644 --- a/internal/repository/testing.go +++ b/internal/repository/testing.go @@ -3,13 +3,14 @@ package repository import ( "context" "os" - "restic" - "restic/backend/local" - "restic/backend/mem" - "restic/crypto" - "restic/test" "testing" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/backend/local" + "github.com/restic/restic/internal/backend/mem" + "github.com/restic/restic/internal/crypto" + "github.com/restic/restic/internal/test" + "github.com/restic/chunker" ) diff --git a/internal/restorer.go b/internal/restorer.go index 3b7f8fc83..bd5be9c5c 100644 --- a/internal/restorer.go +++ b/internal/restorer.go @@ -5,10 +5,10 @@ import ( "os" "path/filepath" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/debug" - "restic/fs" + "github.com/restic/restic/internal/debug" + "github.com/restic/restic/internal/fs" ) // Restorer is used to restore a snapshot to a directory. diff --git a/internal/snapshot.go b/internal/snapshot.go index 9053fa6ec..c6e0dad50 100644 --- a/internal/snapshot.go +++ b/internal/snapshot.go @@ -5,8 +5,9 @@ import ( "fmt" "os/user" "path/filepath" - "restic/debug" "time" + + "github.com/restic/restic/internal/debug" ) // Snapshot is the state of a resource at one point in time. diff --git a/internal/snapshot_find.go b/internal/snapshot_find.go index b55d892c5..4c239fb1e 100644 --- a/internal/snapshot_find.go +++ b/internal/snapshot_find.go @@ -4,8 +4,9 @@ import ( "context" "fmt" "os" - "restic/errors" "time" + + "github.com/restic/restic/internal/errors" ) // ErrNoSnapshotFound is returned when no snapshot for the given criteria could be found. diff --git a/internal/snapshot_policy_test.go b/internal/snapshot_policy_test.go index f7913ccba..3eb8b4ce8 100644 --- a/internal/snapshot_policy_test.go +++ b/internal/snapshot_policy_test.go @@ -6,9 +6,10 @@ import ( "io/ioutil" "path/filepath" "reflect" - "restic" "testing" "time" + + "github.com/restic/restic/internal" ) func parseTimeUTC(s string) time.Time { diff --git a/internal/snapshot_test.go b/internal/snapshot_test.go index 76e95b171..74db91895 100644 --- a/internal/snapshot_test.go +++ b/internal/snapshot_test.go @@ -3,8 +3,8 @@ package restic_test import ( "testing" - "restic" - . "restic/test" + "github.com/restic/restic/internal" + . "github.com/restic/restic/internal/test" ) func TestNewSnapshot(t *testing.T) { diff --git a/internal/test/helpers.go b/internal/test/helpers.go index d208d52dc..2f476995b 100644 --- a/internal/test/helpers.go +++ b/internal/test/helpers.go @@ -10,10 +10,11 @@ import ( "os/exec" "path/filepath" "reflect" - "restic/errors" "runtime" "testing" + "github.com/restic/restic/internal/errors" + mrand "math/rand" ) diff --git a/internal/testing.go b/internal/testing.go index af0a81233..7ddba731a 100644 --- a/internal/testing.go +++ b/internal/testing.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "restic/errors" + "github.com/restic/restic/internal/errors" "github.com/restic/chunker" ) diff --git a/internal/testing_test.go b/internal/testing_test.go index 29b426623..bb7757743 100644 --- a/internal/testing_test.go +++ b/internal/testing_test.go @@ -2,11 +2,12 @@ package restic_test import ( "context" - "restic" - "restic/checker" - "restic/repository" "testing" "time" + + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/checker" + "github.com/restic/restic/internal/repository" ) var testSnapshotTime = time.Unix(1460289341, 207401672) diff --git a/internal/tree.go b/internal/tree.go index 68164f6af..2ae5680ec 100644 --- a/internal/tree.go +++ b/internal/tree.go @@ -4,9 +4,9 @@ import ( "fmt" "sort" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/debug" + "github.com/restic/restic/internal/debug" ) // Tree is an ordered list of nodes. diff --git a/internal/tree_test.go b/internal/tree_test.go index dbdd20d20..1f05e8cc5 100644 --- a/internal/tree_test.go +++ b/internal/tree_test.go @@ -8,9 +8,9 @@ import ( "path/filepath" "testing" - "restic" - "restic/repository" - . "restic/test" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" ) var testFiles = []struct { diff --git a/internal/walk/walk.go b/internal/walk/walk.go index 6ebcb6629..1e9df19d8 100644 --- a/internal/walk/walk.go +++ b/internal/walk/walk.go @@ -5,10 +5,11 @@ import ( "fmt" "os" "path/filepath" - "restic" "sync" - "restic/debug" + "github.com/restic/restic/internal" + + "github.com/restic/restic/internal/debug" ) // TreeJob is a job sent from the tree walker. diff --git a/internal/walk/walk_test.go b/internal/walk/walk_test.go index bdb5cf459..de45d680d 100644 --- a/internal/walk/walk_test.go +++ b/internal/walk/walk_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "restic" - "restic/archiver" - "restic/pipe" - "restic/repository" - . "restic/test" - "restic/walk" + "github.com/restic/restic/internal" + "github.com/restic/restic/internal/archiver" + "github.com/restic/restic/internal/pipe" + "github.com/restic/restic/internal/repository" + . "github.com/restic/restic/internal/test" + "github.com/restic/restic/internal/walk" ) func TestWalkTree(t *testing.T) { diff --git a/internal/worker/pool_test.go b/internal/worker/pool_test.go index f36a98c2e..7c10b7e6a 100644 --- a/internal/worker/pool_test.go +++ b/internal/worker/pool_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "restic/errors" + "github.com/restic/restic/internal/errors" - "restic/worker" + "github.com/restic/restic/internal/worker" ) const concurrency = 10