mirror of
https://github.com/moby/moby.git
synced 2026-08-04 15:11:00 +00:00
fix some gofmt issues reported by goreportcard
https://goreportcard.com/report/github.com/docker/docker
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6ada1cff02)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -53,7 +53,7 @@ func TestAdjustForAPIVersion(t *testing.T) {
|
||||
Target: "/bar",
|
||||
TmpfsOptions: &mount.TmpfsOptions{
|
||||
Options: [][]string{
|
||||
[]string{"exec"},
|
||||
{"exec"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
func TestTmpfsOptionsToGRPC(t *testing.T) {
|
||||
options := [][]string{
|
||||
[]string{"noexec"},
|
||||
[]string{"uid", "12345"},
|
||||
{"noexec"},
|
||||
{"uid", "12345"},
|
||||
}
|
||||
|
||||
expected := `[["noexec"],["uid","12345"]]`
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ func TestTmpfsConversion(t *testing.T) {
|
||||
Target: "/bar",
|
||||
Type: mount.TypeTmpfs,
|
||||
TmpfsOptions: &mount.TmpfsOptions{
|
||||
Options: [][]string{[]string{"exec"}},
|
||||
Options: [][]string{{"exec"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -190,7 +190,7 @@ func TestTmpfsConversion(t *testing.T) {
|
||||
Target: "/bar",
|
||||
Type: mount.TypeTmpfs,
|
||||
TmpfsOptions: &mount.TmpfsOptions{
|
||||
Options: [][]string{[]string{"noexec"}},
|
||||
Options: [][]string{{"noexec"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user