From 07e6b0ac70bb33a9832ae4206bc8a506fdbe41b6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 24 Aug 2023 17:55:14 +0200 Subject: [PATCH] integration: format code with gofumpt Signed-off-by: Sebastiaan van Stijn --- integration/build/build_test.go | 2 +- integration/capabilities/capabilities_linux_test.go | 2 -- integration/config/config_test.go | 6 +++--- integration/daemon/daemon_test.go | 6 +++--- integration/secret/secret_test.go | 6 +++--- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/integration/build/build_test.go b/integration/build/build_test.go index 3dad23108e..8a7d0a5e15 100644 --- a/integration/build/build_test.go +++ b/integration/build/build_test.go @@ -700,7 +700,7 @@ func TestBuildPlatformInvalid(t *testing.T) { func writeTarRecord(t *testing.T, w *tar.Writer, fn, contents string) { err := w.WriteHeader(&tar.Header{ Name: fn, - Mode: 0600, + Mode: 0o600, Size: int64(len(contents)), Typeflag: '0', }) diff --git a/integration/capabilities/capabilities_linux_test.go b/integration/capabilities/capabilities_linux_test.go index 272f3dcdb7..836d7af8cc 100644 --- a/integration/capabilities/capabilities_linux_test.go +++ b/integration/capabilities/capabilities_linux_test.go @@ -100,9 +100,7 @@ func TestNoNewPrivileges(t *testing.T) { } if stdErr != tc.stdErr { t.Fatalf("test produced invalid error: %q, expected %q. Stdout:%q", stdErr, tc.stdErr, stdOut) - } }) } - } diff --git a/integration/config/config_test.go b/integration/config/config_test.go index 9fcb8af2ff..a19917998f 100644 --- a/integration/config/config_test.go +++ b/integration/config/config_test.go @@ -268,7 +268,7 @@ func TestTemplatedConfig(t *testing.T) { Name: "templated_config", UID: "0", GID: "0", - Mode: 0600, + Mode: 0o600, }, ConfigID: templatedConfig.ID, ConfigName: templatedConfigName, @@ -280,7 +280,7 @@ func TestTemplatedConfig(t *testing.T) { Name: "referencedconfigtarget", UID: "0", GID: "0", - Mode: 0600, + Mode: 0o600, }, ConfigID: referencedConfig.ID, ConfigName: referencedConfigName, @@ -292,7 +292,7 @@ func TestTemplatedConfig(t *testing.T) { Name: "referencedsecrettarget", UID: "0", GID: "0", - Mode: 0600, + Mode: 0o600, }, SecretID: referencedSecret.ID, SecretName: referencedSecretName, diff --git a/integration/daemon/daemon_test.go b/integration/daemon/daemon_test.go index d21d879f3c..b2821147c9 100644 --- a/integration/daemon/daemon_test.go +++ b/integration/daemon/daemon_test.go @@ -155,7 +155,7 @@ func TestConfigDaemonSeccompProfiles(t *testing.T) { d.Stop(t) cfg := filepath.Join(d.RootDir(), "daemon.json") - err := os.WriteFile(cfg, []byte(`{"seccomp-profile": "`+tc.profile+`"}`), 0644) + err := os.WriteFile(cfg, []byte(`{"seccomp-profile": "`+tc.profile+`"}`), 0o644) assert.NilError(t, err) d.Start(t, "--config-file", cfg) @@ -285,7 +285,7 @@ func TestDaemonProxy(t *testing.T) { configFile := filepath.Join(d.RootDir(), "daemon.json") configJSON := fmt.Sprintf(`{"proxies":{"http-proxy":%[1]q, "https-proxy": %[1]q, "no-proxy": "example.com"}}`, proxyServer.URL) - assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0644)) + assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0o644)) d.Start(t, "--iptables=false", "--config-file", configFile) defer d.Stop(t) @@ -327,7 +327,7 @@ func TestDaemonProxy(t *testing.T) { configFile := filepath.Join(d.RootDir(), "daemon.json") configJSON := fmt.Sprintf(`{"proxies":{"http-proxy":%[1]q, "https-proxy": %[1]q, "no-proxy": "example.com"}}`, proxyRawURL) - assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0644)) + assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0o644)) err := d.StartWithError("--http-proxy", proxyRawURL, "--https-proxy", proxyRawURL, "--no-proxy", "example.com", "--config-file", configFile, "--validate") assert.ErrorContains(t, err, "daemon exited during startup") diff --git a/integration/secret/secret_test.go b/integration/secret/secret_test.go index 298cf0e359..ab11538d6d 100644 --- a/integration/secret/secret_test.go +++ b/integration/secret/secret_test.go @@ -277,7 +277,7 @@ func TestTemplatedSecret(t *testing.T) { Name: "templated_secret", UID: "0", GID: "0", - Mode: 0600, + Mode: 0o600, }, SecretID: templatedSecret.ID, SecretName: templatedSecretName, @@ -289,7 +289,7 @@ func TestTemplatedSecret(t *testing.T) { Name: "referencedconfigtarget", UID: "0", GID: "0", - Mode: 0600, + Mode: 0o600, }, ConfigID: referencedConfig.ID, ConfigName: referencedConfigName, @@ -301,7 +301,7 @@ func TestTemplatedSecret(t *testing.T) { Name: "referencedsecrettarget", UID: "0", GID: "0", - Mode: 0600, + Mode: 0o600, }, SecretID: referencedSecret.ID, SecretName: referencedSecretName,