mirror of https://github.com/docker/cli.git
Merge pull request #994 from silvin-lubecki/fix-gometalinter
Fixed gometalinter errors on test files
This commit is contained in:
commit
8e1cd515ba
|
@ -100,7 +100,7 @@ func TestGetExitStatus(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
result: &container.ContainerWaitOKBody{
|
result: &container.ContainerWaitOKBody{
|
||||||
Error: &container.ContainerWaitOKBodyError{expectedErr.Error()},
|
Error: &container.ContainerWaitOKBodyError{Message: expectedErr.Error()},
|
||||||
},
|
},
|
||||||
expectedError: expectedErr,
|
expectedError: expectedErr,
|
||||||
},
|
},
|
||||||
|
|
|
@ -38,9 +38,9 @@ checkpoint-3:
|
||||||
}
|
}
|
||||||
|
|
||||||
checkpoints := []types.Checkpoint{
|
checkpoints := []types.Checkpoint{
|
||||||
{"checkpoint-1"},
|
{Name: "checkpoint-1"},
|
||||||
{"checkpoint-2"},
|
{Name: "checkpoint-2"},
|
||||||
{"checkpoint-3"},
|
{Name: "checkpoint-3"},
|
||||||
}
|
}
|
||||||
for _, testcase := range cases {
|
for _, testcase := range cases {
|
||||||
out := bytes.NewBufferString("")
|
out := bytes.NewBufferString("")
|
||||||
|
|
|
@ -42,9 +42,9 @@ D: /usr/app/old_app.js
|
||||||
}
|
}
|
||||||
|
|
||||||
diffs := []container.ContainerChangeResponseItem{
|
diffs := []container.ContainerChangeResponseItem{
|
||||||
{archive.ChangeModify, "/var/log/app.log"},
|
{Kind: archive.ChangeModify, Path: "/var/log/app.log"},
|
||||||
{archive.ChangeAdd, "/usr/app/app.js"},
|
{Kind: archive.ChangeAdd, Path: "/usr/app/app.js"},
|
||||||
{archive.ChangeDelete, "/usr/app/old_app.js"},
|
{Kind: archive.ChangeDelete, Path: "/usr/app/old_app.js"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range cases {
|
for _, testcase := range cases {
|
||||||
|
|
|
@ -46,10 +46,10 @@ func TestNetworkConnectErrors(t *testing.T) {
|
||||||
func TestNetworkConnectWithFlags(t *testing.T) {
|
func TestNetworkConnectWithFlags(t *testing.T) {
|
||||||
expectedOpts := []network.IPAMConfig{
|
expectedOpts := []network.IPAMConfig{
|
||||||
{
|
{
|
||||||
"192.168.4.0/24",
|
Subnet: "192.168.4.0/24",
|
||||||
"192.168.4.0/24",
|
IPRange: "192.168.4.0/24",
|
||||||
"192.168.4.1/24",
|
Gateway: "192.168.4.1/24",
|
||||||
map[string]string{},
|
AuxAddress: map[string]string{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cli := test.NewFakeCli(&fakeClient{
|
cli := test.NewFakeCli(&fakeClient{
|
||||||
|
|
|
@ -146,10 +146,10 @@ func TestNetworkCreateWithFlags(t *testing.T) {
|
||||||
expectedDriver := "foo"
|
expectedDriver := "foo"
|
||||||
expectedOpts := []network.IPAMConfig{
|
expectedOpts := []network.IPAMConfig{
|
||||||
{
|
{
|
||||||
"192.168.4.0/24",
|
Subnet: "192.168.4.0/24",
|
||||||
"192.168.4.0/24",
|
IPRange: "192.168.4.0/24",
|
||||||
"192.168.4.1/24",
|
Gateway: "192.168.4.1/24",
|
||||||
map[string]string{},
|
AuxAddress: map[string]string{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cli := test.NewFakeCli(&fakeClient{
|
cli := test.NewFakeCli(&fakeClient{
|
||||||
|
|
|
@ -55,9 +55,9 @@ func TestHealthCheckOptionsToHealthConfig(t *testing.T) {
|
||||||
dur := time.Second
|
dur := time.Second
|
||||||
opt := healthCheckOptions{
|
opt := healthCheckOptions{
|
||||||
cmd: "curl",
|
cmd: "curl",
|
||||||
interval: opts.PositiveDurationOpt{*opts.NewDurationOpt(&dur)},
|
interval: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
|
||||||
timeout: opts.PositiveDurationOpt{*opts.NewDurationOpt(&dur)},
|
timeout: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
|
||||||
startPeriod: opts.PositiveDurationOpt{*opts.NewDurationOpt(&dur)},
|
startPeriod: opts.PositiveDurationOpt{DurationOpt: *opts.NewDurationOpt(&dur)},
|
||||||
retries: 10,
|
retries: 10,
|
||||||
}
|
}
|
||||||
config, err := opt.toHealthConfig()
|
config, err := opt.toHealthConfig()
|
||||||
|
|
|
@ -50,8 +50,8 @@ func TestKubernetesServiceToSwarmServiceConversion(t *testing.T) {
|
||||||
makeSwarmService("stack_service2", "uid2", nil),
|
makeSwarmService("stack_service2", "uid2", nil),
|
||||||
},
|
},
|
||||||
map[string]formatter.ServiceListInfo{
|
map[string]formatter.ServiceListInfo{
|
||||||
"uid1": {"replicated", "2/5"},
|
"uid1": {Mode: "replicated", Replicas: "2/5"},
|
||||||
"uid2": {"replicated", "3/3"},
|
"uid2": {Mode: "replicated", Replicas: "3/3"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Headless service and LoadBalancer Service are tied to the same Swarm service
|
// Headless service and LoadBalancer Service are tied to the same Swarm service
|
||||||
|
@ -84,7 +84,7 @@ func TestKubernetesServiceToSwarmServiceConversion(t *testing.T) {
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
map[string]formatter.ServiceListInfo{
|
map[string]formatter.ServiceListInfo{
|
||||||
"uid1": {"replicated", "1/1"},
|
"uid1": {Mode: "replicated", Replicas: "1/1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Headless service and NodePort Service are tied to the same Swarm service
|
// Headless service and NodePort Service are tied to the same Swarm service
|
||||||
|
@ -118,7 +118,7 @@ func TestKubernetesServiceToSwarmServiceConversion(t *testing.T) {
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
map[string]formatter.ServiceListInfo{
|
map[string]formatter.ServiceListInfo{
|
||||||
"uid1": {"replicated", "1/1"},
|
"uid1": {Mode: "replicated", Replicas: "1/1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ func mockDelegationRoleWithName(name string) data.DelegationRole {
|
||||||
data.RoleName(name),
|
data.RoleName(name),
|
||||||
notary.MinThreshold,
|
notary.MinThreshold,
|
||||||
)
|
)
|
||||||
return data.DelegationRole{baseRole, []string{}}
|
return data.DelegationRole{BaseRole: baseRole, Paths: []string{}}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMatchEmptySignatures(t *testing.T) {
|
func TestMatchEmptySignatures(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue