Skip to content

Commit bf222d6

Browse files
committed
fix some gofmt issues reported by goreportcard
https://goreportcard.com/report/github.com/docker/docker Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 6ada1cf) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b70040a commit bf222d6

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

api/server/router/swarm/helpers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestAdjustForAPIVersion(t *testing.T) {
5353
Target: "/bar",
5454
TmpfsOptions: &mount.TmpfsOptions{
5555
Options: [][]string{
56-
[]string{"exec"},
56+
{"exec"},
5757
},
5858
},
5959
},
@@ -73,7 +73,7 @@ func TestAdjustForAPIVersion(t *testing.T) {
7373
adjustForAPIVersion("1.46", spec)
7474
if !reflect.DeepEqual(
7575
spec.TaskTemplate.ContainerSpec.Mounts[0].TmpfsOptions.Options,
76-
[][]string{[]string{"exec"}},
76+
[][]string{{"exec"}},
7777
) {
7878
t.Error("TmpfsOptions.Options was stripped from spec")
7979
}

daemon/cluster/convert/container_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88

99
func TestTmpfsOptionsToGRPC(t *testing.T) {
1010
options := [][]string{
11-
[]string{"noexec"},
12-
[]string{"uid", "12345"},
11+
{"noexec"},
12+
{"uid", "12345"},
1313
}
1414

1515
expected := `[["noexec"],["uid","12345"]]`
@@ -21,8 +21,8 @@ func TestTmpfsOptionsFromGRPC(t *testing.T) {
2121
options := `[["noexec"],["uid","12345"]]`
2222

2323
expected := [][]string{
24-
[]string{"noexec"},
25-
[]string{"uid", "12345"},
24+
{"noexec"},
25+
{"uid", "12345"},
2626
}
2727
actual := tmpfsOptionsFromGRPC(options)
2828

daemon/cluster/executor/container/container_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func TestTmpfsConversion(t *testing.T) {
167167
Target: "/bar",
168168
Type: mount.TypeTmpfs,
169169
TmpfsOptions: &mount.TmpfsOptions{
170-
Options: [][]string{[]string{"exec"}},
170+
Options: [][]string{{"exec"}},
171171
},
172172
},
173173
},
@@ -190,7 +190,7 @@ func TestTmpfsConversion(t *testing.T) {
190190
Target: "/bar",
191191
Type: mount.TypeTmpfs,
192192
TmpfsOptions: &mount.TmpfsOptions{
193-
Options: [][]string{[]string{"noexec"}},
193+
Options: [][]string{{"noexec"}},
194194
},
195195
},
196196
},

integration/image/save_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ func TestSaveOCI(t *testing.T) {
108108

109109
testCases := []testCase{
110110
// Busybox by tagged name
111-
testCase{image: busybox, expectedContainerdRef: "docker.io/library/busybox:latest", expectedOCIRef: "latest"},
111+
{image: busybox, expectedContainerdRef: "docker.io/library/busybox:latest", expectedOCIRef: "latest"},
112112

113113
// Busybox by ID
114-
testCase{image: inspectBusybox.ID},
114+
{image: inspectBusybox.ID},
115115
}
116116

117117
if testEnv.DaemonInfo.OSType != "windows" {

0 commit comments

Comments
 (0)