mirror of
https://github.com/octoleo/restic.git
synced 2025-01-04 07:37:57 +00:00
backend: fix linter warnings
This commit is contained in:
parent
a27b7f1370
commit
25a0be7f26
@ -7,17 +7,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
{"azure:container-name:/", Config{
|
{S: "azure:container-name:/", Cfg: Config{
|
||||||
Container: "container-name",
|
Container: "container-name",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"azure:container-name:/prefix/directory", Config{
|
{S: "azure:container-name:/prefix/directory", Cfg: Config{
|
||||||
Container: "container-name",
|
Container: "container-name",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"azure:container-name:/prefix/directory/", Config{
|
{S: "azure:container-name:/prefix/directory/", Cfg: Config{
|
||||||
Container: "container-name",
|
Container: "container-name",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
|
@ -7,32 +7,32 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
{"b2:bucketname", Config{
|
{S: "b2:bucketname", Cfg: Config{
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"b2:bucketname:", Config{
|
{S: "b2:bucketname:", Cfg: Config{
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"b2:bucketname:/prefix/directory", Config{
|
{S: "b2:bucketname:/prefix/directory", Cfg: Config{
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"b2:foobar", Config{
|
{S: "b2:foobar", Cfg: Config{
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"b2:foobar:", Config{
|
{S: "b2:foobar:", Cfg: Config{
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"b2:foobar:/", Config{
|
{S: "b2:foobar:/", Cfg: Config{
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
|
@ -7,19 +7,19 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
{"gs:bucketname:/", Config{
|
{S: "gs:bucketname:/", Cfg: Config{
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
Region: "us",
|
Region: "us",
|
||||||
}},
|
}},
|
||||||
{"gs:bucketname:/prefix/directory", Config{
|
{S: "gs:bucketname:/prefix/directory", Cfg: Config{
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
Region: "us",
|
Region: "us",
|
||||||
}},
|
}},
|
||||||
{"gs:bucketname:/prefix/directory/", Config{
|
{S: "gs:bucketname:/prefix/directory/", Cfg: Config{
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
{
|
{
|
||||||
"rclone:local:foo:/bar",
|
S: "rclone:local:foo:/bar",
|
||||||
Config{
|
Cfg: Config{
|
||||||
Remote: "local:foo:/bar",
|
Remote: "local:foo:/bar",
|
||||||
Program: defaultConfig.Program,
|
Program: defaultConfig.Program,
|
||||||
Args: defaultConfig.Args,
|
Args: defaultConfig.Args,
|
||||||
|
@ -8,88 +8,88 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
{"s3://eu-central-1/bucketname", Config{
|
{S: "s3://eu-central-1/bucketname", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3://eu-central-1/bucketname/", Config{
|
{S: "s3://eu-central-1/bucketname/", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3://eu-central-1/bucketname/prefix/directory", Config{
|
{S: "s3://eu-central-1/bucketname/prefix/directory", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3://eu-central-1/bucketname/prefix/directory/", Config{
|
{S: "s3://eu-central-1/bucketname/prefix/directory/", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "bucketname",
|
Bucket: "bucketname",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:eu-central-1/foobar", Config{
|
{S: "s3:eu-central-1/foobar", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:eu-central-1/foobar/", Config{
|
{S: "s3:eu-central-1/foobar/", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:eu-central-1/foobar/prefix/directory", Config{
|
{S: "s3:eu-central-1/foobar/prefix/directory", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:eu-central-1/foobar/prefix/directory/", Config{
|
{S: "s3:eu-central-1/foobar/prefix/directory/", Cfg: Config{
|
||||||
Endpoint: "eu-central-1",
|
Endpoint: "eu-central-1",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:https://hostname:9999/foobar", Config{
|
{S: "s3:https://hostname:9999/foobar", Cfg: Config{
|
||||||
Endpoint: "hostname:9999",
|
Endpoint: "hostname:9999",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:https://hostname:9999/foobar/", Config{
|
{S: "s3:https://hostname:9999/foobar/", Cfg: Config{
|
||||||
Endpoint: "hostname:9999",
|
Endpoint: "hostname:9999",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:http://hostname:9999/foobar", Config{
|
{S: "s3:http://hostname:9999/foobar", Cfg: Config{
|
||||||
Endpoint: "hostname:9999",
|
Endpoint: "hostname:9999",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
UseHTTP: true,
|
UseHTTP: true,
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:http://hostname:9999/foobar/", Config{
|
{S: "s3:http://hostname:9999/foobar/", Cfg: Config{
|
||||||
Endpoint: "hostname:9999",
|
Endpoint: "hostname:9999",
|
||||||
Bucket: "foobar",
|
Bucket: "foobar",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
UseHTTP: true,
|
UseHTTP: true,
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:http://hostname:9999/bucket/prefix/directory", Config{
|
{S: "s3:http://hostname:9999/bucket/prefix/directory", Cfg: Config{
|
||||||
Endpoint: "hostname:9999",
|
Endpoint: "hostname:9999",
|
||||||
Bucket: "bucket",
|
Bucket: "bucket",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
UseHTTP: true,
|
UseHTTP: true,
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
}},
|
}},
|
||||||
{"s3:http://hostname:9999/bucket/prefix/directory/", Config{
|
{S: "s3:http://hostname:9999/bucket/prefix/directory/", Cfg: Config{
|
||||||
Endpoint: "hostname:9999",
|
Endpoint: "hostname:9999",
|
||||||
Bucket: "bucket",
|
Bucket: "bucket",
|
||||||
Prefix: "prefix/directory",
|
Prefix: "prefix/directory",
|
||||||
|
@ -9,69 +9,69 @@ import (
|
|||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
// first form, user specified sftp://user@host/dir
|
// first form, user specified sftp://user@host/dir
|
||||||
{
|
{
|
||||||
"sftp://user@host/dir/subdir",
|
S: "sftp://user@host/dir/subdir",
|
||||||
Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp://host/dir/subdir",
|
S: "sftp://host/dir/subdir",
|
||||||
Config{Host: "host", Path: "dir/subdir", Connections: 5},
|
Cfg: Config{Host: "host", Path: "dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp://host//dir/subdir",
|
S: "sftp://host//dir/subdir",
|
||||||
Config{Host: "host", Path: "/dir/subdir", Connections: 5},
|
Cfg: Config{Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp://host:10022//dir/subdir",
|
S: "sftp://host:10022//dir/subdir",
|
||||||
Config{Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
Cfg: Config{Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp://user@host:10022//dir/subdir",
|
S: "sftp://user@host:10022//dir/subdir",
|
||||||
Config{User: "user", Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Port: "10022", Path: "/dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp://user@host/dir/subdir/../other",
|
S: "sftp://user@host/dir/subdir/../other",
|
||||||
Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp://user@host/dir///subdir",
|
S: "sftp://user@host/dir///subdir",
|
||||||
Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
|
|
||||||
// IPv6 address.
|
// IPv6 address.
|
||||||
{
|
{
|
||||||
"sftp://user@[::1]/dir",
|
S: "sftp://user@[::1]/dir",
|
||||||
Config{User: "user", Host: "::1", Path: "dir", Connections: 5},
|
Cfg: Config{User: "user", Host: "::1", Path: "dir", Connections: 5},
|
||||||
},
|
},
|
||||||
// IPv6 address with port.
|
// IPv6 address with port.
|
||||||
{
|
{
|
||||||
"sftp://user@[::1]:22/dir",
|
S: "sftp://user@[::1]:22/dir",
|
||||||
Config{User: "user", Host: "::1", Port: "22", Path: "dir", Connections: 5},
|
Cfg: Config{User: "user", Host: "::1", Port: "22", Path: "dir", Connections: 5},
|
||||||
},
|
},
|
||||||
|
|
||||||
// second form, user specified sftp:user@host:/dir
|
// second form, user specified sftp:user@host:/dir
|
||||||
{
|
{
|
||||||
"sftp:user@host:/dir/subdir",
|
S: "sftp:user@host:/dir/subdir",
|
||||||
Config{User: "user", Host: "host", Path: "/dir/subdir", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp:user@domain@host:/dir/subdir",
|
S: "sftp:user@domain@host:/dir/subdir",
|
||||||
Config{User: "user@domain", Host: "host", Path: "/dir/subdir", Connections: 5},
|
Cfg: Config{User: "user@domain", Host: "host", Path: "/dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp:host:../dir/subdir",
|
S: "sftp:host:../dir/subdir",
|
||||||
Config{Host: "host", Path: "../dir/subdir", Connections: 5},
|
Cfg: Config{Host: "host", Path: "../dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp:user@host:dir/subdir:suffix",
|
S: "sftp:user@host:dir/subdir:suffix",
|
||||||
Config{User: "user", Host: "host", Path: "dir/subdir:suffix", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir:suffix", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp:user@host:dir/subdir/../other",
|
S: "sftp:user@host:dir/subdir/../other",
|
||||||
Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "dir/other", Connections: 5},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sftp:user@host:dir///subdir",
|
S: "sftp:user@host:dir///subdir",
|
||||||
Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
Cfg: Config{User: "user", Host: "host", Path: "dir/subdir", Connections: 5},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,23 +8,23 @@ import (
|
|||||||
|
|
||||||
var configTests = []test.ConfigTestData[Config]{
|
var configTests = []test.ConfigTestData[Config]{
|
||||||
{
|
{
|
||||||
"swift:cnt1:/",
|
S: "swift:cnt1:/",
|
||||||
Config{
|
Cfg: Config{
|
||||||
Container: "cnt1",
|
Container: "cnt1",
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"swift:cnt2:/prefix",
|
S: "swift:cnt2:/prefix",
|
||||||
Config{Container: "cnt2",
|
Cfg: Config{Container: "cnt2",
|
||||||
Prefix: "prefix",
|
Prefix: "prefix",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"swift:cnt3:/prefix/longer",
|
S: "swift:cnt3:/prefix/longer",
|
||||||
Config{Container: "cnt3",
|
Cfg: Config{Container: "cnt3",
|
||||||
Prefix: "prefix/longer",
|
Prefix: "prefix/longer",
|
||||||
Connections: 5,
|
Connections: 5,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user