Selaa lähdekoodia

integration/plugin: format code with gofumpt

Formatting the code with https://github.com/mvdan/gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 3 vuotta sitten
vanhempi
commit
bb5ace2efb

+ 2 - 2
integration/plugin/authz/authz_plugin_test.go

@@ -55,11 +55,11 @@ func setupTestV1(t *testing.T) func() {
 	ctrl = &authorizationController{}
 	teardown := setupTest(t)
 
-	err := os.MkdirAll("/etc/docker/plugins", 0755)
+	err := os.MkdirAll("/etc/docker/plugins", 0o755)
 	assert.NilError(t, err)
 
 	fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", testAuthZPlugin)
-	err = os.WriteFile(fileName, []byte(server.URL), 0644)
+	err = os.WriteFile(fileName, []byte(server.URL), 0o644)
 	assert.NilError(t, err)
 
 	return func() {

+ 2 - 2
integration/plugin/common/plugin_test.go

@@ -231,7 +231,7 @@ func TestPluginsWithRuntimes(t *testing.T) {
 	exec runc $@
 	`, dir)
 
-	assert.NilError(t, os.WriteFile(p, []byte(script), 0777))
+	assert.NilError(t, os.WriteFile(p, []byte(script), 0o777))
 
 	type config struct {
 		Runtimes map[string]types.Runtime `json:"runtimes"`
@@ -244,7 +244,7 @@ func TestPluginsWithRuntimes(t *testing.T) {
 		},
 	})
 	configPath := filepath.Join(dir, "config.json")
-	os.WriteFile(configPath, cfg, 0644)
+	os.WriteFile(configPath, cfg, 0o644)
 
 	t.Run("No Args", func(t *testing.T) {
 		d.Restart(t, "--default-runtime=myrt", "--config-file="+configPath)

+ 2 - 2
integration/plugin/graphdriver/external_test.go

@@ -344,11 +344,11 @@ func setupPlugin(t *testing.T, ec map[string]*graphEventsCounter, ext string, mu
 		respond(w, &graphDriverResponse{Size: size})
 	})
 
-	err = os.MkdirAll("/etc/docker/plugins", 0755)
+	err = os.MkdirAll("/etc/docker/plugins", 0o755)
 	assert.NilError(t, err)
 
 	specFile := "/etc/docker/plugins/" + name + "." + ext
-	err = os.WriteFile(specFile, b, 0644)
+	err = os.WriteFile(specFile, b, 0o644)
 	assert.NilError(t, err)
 }
 

+ 1 - 3
integration/plugin/graphdriver/main_test.go

@@ -8,9 +8,7 @@ import (
 	"github.com/docker/docker/testutil/environment"
 )
 
-var (
-	testEnv *environment.Execution
-)
+var testEnv *environment.Execution
 
 func TestMain(m *testing.M) {
 	var err error

+ 1 - 1
integration/plugin/logging/cmd/close_on_start/main.go

@@ -27,7 +27,7 @@ func main() {
 			return
 		}
 
-		f, err := os.OpenFile(startReq.File, os.O_RDONLY, 0600)
+		f, err := os.OpenFile(startReq.File, os.O_RDONLY, 0o600)
 		if err != nil {
 			http.Error(w, err.Error(), http.StatusInternalServerError)
 			return

+ 1 - 1
integration/plugin/logging/cmd/discard/driver.go

@@ -37,7 +37,7 @@ func handle(mux *http.ServeMux) {
 			return
 		}
 
-		f, err := os.OpenFile(req.File, syscall.O_RDONLY, 0700)
+		f, err := os.OpenFile(req.File, syscall.O_RDONLY, 0o700)
 		if err != nil {
 			respond(err, w)
 		}

+ 1 - 3
integration/plugin/logging/main_test.go

@@ -8,9 +8,7 @@ import (
 	"github.com/docker/docker/testutil/environment"
 )
 
-var (
-	testEnv *environment.Execution
-)
+var testEnv *environment.Execution
 
 func TestMain(m *testing.M) {
 	var err error

+ 1 - 3
integration/plugin/volumes/main_test.go

@@ -8,9 +8,7 @@ import (
 	"github.com/docker/docker/testutil/environment"
 )
 
-var (
-	testEnv *environment.Execution
-)
+var testEnv *environment.Execution
 
 func TestMain(m *testing.M) {
 	var err error