Browse code

integration: format code with gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2023/08/25 00:55:14
Showing 5 changed files
... ...
@@ -700,7 +700,7 @@ func TestBuildPlatformInvalid(t *testing.T) {
700 700
 func writeTarRecord(t *testing.T, w *tar.Writer, fn, contents string) {
701 701
 	err := w.WriteHeader(&tar.Header{
702 702
 		Name:     fn,
703
-		Mode:     0600,
703
+		Mode:     0o600,
704 704
 		Size:     int64(len(contents)),
705 705
 		Typeflag: '0',
706 706
 	})
... ...
@@ -100,9 +100,7 @@ func TestNoNewPrivileges(t *testing.T) {
100 100
 			}
101 101
 			if stdErr != tc.stdErr {
102 102
 				t.Fatalf("test produced invalid error: %q, expected %q. Stdout:%q", stdErr, tc.stdErr, stdOut)
103
-
104 103
 			}
105 104
 		})
106 105
 	}
107
-
108 106
 }
... ...
@@ -268,7 +268,7 @@ func TestTemplatedConfig(t *testing.T) {
268 268
 					Name: "templated_config",
269 269
 					UID:  "0",
270 270
 					GID:  "0",
271
-					Mode: 0600,
271
+					Mode: 0o600,
272 272
 				},
273 273
 				ConfigID:   templatedConfig.ID,
274 274
 				ConfigName: templatedConfigName,
... ...
@@ -280,7 +280,7 @@ func TestTemplatedConfig(t *testing.T) {
280 280
 					Name: "referencedconfigtarget",
281 281
 					UID:  "0",
282 282
 					GID:  "0",
283
-					Mode: 0600,
283
+					Mode: 0o600,
284 284
 				},
285 285
 				ConfigID:   referencedConfig.ID,
286 286
 				ConfigName: referencedConfigName,
... ...
@@ -292,7 +292,7 @@ func TestTemplatedConfig(t *testing.T) {
292 292
 					Name: "referencedsecrettarget",
293 293
 					UID:  "0",
294 294
 					GID:  "0",
295
-					Mode: 0600,
295
+					Mode: 0o600,
296 296
 				},
297 297
 				SecretID:   referencedSecret.ID,
298 298
 				SecretName: referencedSecretName,
... ...
@@ -155,7 +155,7 @@ func TestConfigDaemonSeccompProfiles(t *testing.T) {
155 155
 			d.Stop(t)
156 156
 
157 157
 			cfg := filepath.Join(d.RootDir(), "daemon.json")
158
-			err := os.WriteFile(cfg, []byte(`{"seccomp-profile": "`+tc.profile+`"}`), 0644)
158
+			err := os.WriteFile(cfg, []byte(`{"seccomp-profile": "`+tc.profile+`"}`), 0o644)
159 159
 			assert.NilError(t, err)
160 160
 
161 161
 			d.Start(t, "--config-file", cfg)
... ...
@@ -285,7 +285,7 @@ func TestDaemonProxy(t *testing.T) {
285 285
 
286 286
 		configFile := filepath.Join(d.RootDir(), "daemon.json")
287 287
 		configJSON := fmt.Sprintf(`{"proxies":{"http-proxy":%[1]q, "https-proxy": %[1]q, "no-proxy": "example.com"}}`, proxyServer.URL)
288
-		assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0644))
288
+		assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0o644))
289 289
 
290 290
 		d.Start(t, "--iptables=false", "--config-file", configFile)
291 291
 		defer d.Stop(t)
... ...
@@ -327,7 +327,7 @@ func TestDaemonProxy(t *testing.T) {
327 327
 
328 328
 		configFile := filepath.Join(d.RootDir(), "daemon.json")
329 329
 		configJSON := fmt.Sprintf(`{"proxies":{"http-proxy":%[1]q, "https-proxy": %[1]q, "no-proxy": "example.com"}}`, proxyRawURL)
330
-		assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0644))
330
+		assert.NilError(t, os.WriteFile(configFile, []byte(configJSON), 0o644))
331 331
 
332 332
 		err := d.StartWithError("--http-proxy", proxyRawURL, "--https-proxy", proxyRawURL, "--no-proxy", "example.com", "--config-file", configFile, "--validate")
333 333
 		assert.ErrorContains(t, err, "daemon exited during startup")
... ...
@@ -277,7 +277,7 @@ func TestTemplatedSecret(t *testing.T) {
277 277
 					Name: "templated_secret",
278 278
 					UID:  "0",
279 279
 					GID:  "0",
280
-					Mode: 0600,
280
+					Mode: 0o600,
281 281
 				},
282 282
 				SecretID:   templatedSecret.ID,
283 283
 				SecretName: templatedSecretName,
... ...
@@ -289,7 +289,7 @@ func TestTemplatedSecret(t *testing.T) {
289 289
 					Name: "referencedconfigtarget",
290 290
 					UID:  "0",
291 291
 					GID:  "0",
292
-					Mode: 0600,
292
+					Mode: 0o600,
293 293
 				},
294 294
 				ConfigID:   referencedConfig.ID,
295 295
 				ConfigName: referencedConfigName,
... ...
@@ -301,7 +301,7 @@ func TestTemplatedSecret(t *testing.T) {
301 301
 					Name: "referencedsecrettarget",
302 302
 					UID:  "0",
303 303
 					GID:  "0",
304
-					Mode: 0600,
304
+					Mode: 0o600,
305 305
 				},
306 306
 				SecretID:   referencedSecret.ID,
307 307
 				SecretName: referencedSecretName,