Skip to content

Commit

Permalink
fix some gofmt issues reported by goreportcard
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
thaJeztah committed Jun 28, 2024
1 parent b70040a commit bf222d6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/server/router/swarm/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestAdjustForAPIVersion(t *testing.T) {
Target: "/bar",
TmpfsOptions: &mount.TmpfsOptions{
Options: [][]string{
[]string{"exec"},
{"exec"},
},
},
},
Expand All @@ -73,7 +73,7 @@ func TestAdjustForAPIVersion(t *testing.T) {
adjustForAPIVersion("1.46", spec)
if !reflect.DeepEqual(
spec.TaskTemplate.ContainerSpec.Mounts[0].TmpfsOptions.Options,
[][]string{[]string{"exec"}},
[][]string{{"exec"}},
) {
t.Error("TmpfsOptions.Options was stripped from spec")
}
Expand Down
8 changes: 4 additions & 4 deletions daemon/cluster/convert/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

func TestTmpfsOptionsToGRPC(t *testing.T) {
options := [][]string{
[]string{"noexec"},
[]string{"uid", "12345"},
{"noexec"},
{"uid", "12345"},
}

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

expected := [][]string{
[]string{"noexec"},
[]string{"uid", "12345"},
{"noexec"},
{"uid", "12345"},
}
actual := tmpfsOptionsFromGRPC(options)

Expand Down
4 changes: 2 additions & 2 deletions daemon/cluster/executor/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestTmpfsConversion(t *testing.T) {
Target: "/bar",
Type: mount.TypeTmpfs,
TmpfsOptions: &mount.TmpfsOptions{
Options: [][]string{[]string{"exec"}},
Options: [][]string{{"exec"}},
},
},
},
Expand All @@ -190,7 +190,7 @@ func TestTmpfsConversion(t *testing.T) {
Target: "/bar",
Type: mount.TypeTmpfs,
TmpfsOptions: &mount.TmpfsOptions{
Options: [][]string{[]string{"noexec"}},
Options: [][]string{{"noexec"}},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions integration/image/save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ func TestSaveOCI(t *testing.T) {

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

// Busybox by ID
testCase{image: inspectBusybox.ID},
{image: inspectBusybox.ID},
}

if testEnv.DaemonInfo.OSType != "windows" {
Expand Down

0 comments on commit bf222d6

Please sign in to comment.