Browse code

client: 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 authored on 2022/01/20 21:49:39
Showing 6 changed files
... ...
@@ -67,7 +67,6 @@ func TestCheckpointCreate(t *testing.T) {
67 67
 		CheckpointID: expectedCheckpointID,
68 68
 		Exit:         true,
69 69
 	})
70
-
71 70
 	if err != nil {
72 71
 		t.Fatal(err)
73 72
 	}
... ...
@@ -48,7 +48,6 @@ func TestCheckpointDelete(t *testing.T) {
48 48
 	err := client.CheckpointDelete(context.Background(), "container_id", types.CheckpointDeleteOptions{
49 49
 		CheckpointID: "checkpoint_id",
50 50
 	})
51
-
52 51
 	if err != nil {
53 52
 		t.Fatal(err)
54 53
 	}
... ...
@@ -66,7 +66,7 @@ func TestContainerStatPath(t *testing.T) {
66 66
 			}
67 67
 			content, err := json.Marshal(types.ContainerPathStat{
68 68
 				Name: "name",
69
-				Mode: 0700,
69
+				Mode: 0o700,
70 70
 			})
71 71
 			if err != nil {
72 72
 				return nil, err
... ...
@@ -88,7 +88,7 @@ func TestContainerStatPath(t *testing.T) {
88 88
 	if stat.Name != "name" {
89 89
 		t.Fatalf("expected container path stat name to be 'name', got '%s'", stat.Name)
90 90
 	}
91
-	if stat.Mode != 0700 {
91
+	if stat.Mode != 0o700 {
92 92
 		t.Fatalf("expected container path stat mode to be 0700, got '%v'", stat.Mode)
93 93
 	}
94 94
 }
... ...
@@ -190,7 +190,7 @@ func TestCopyFromContainerEmptyResponse(t *testing.T) {
190 190
 		client: newMockClient(func(req *http.Request) (*http.Response, error) {
191 191
 			content, err := json.Marshal(types.ContainerPathStat{
192 192
 				Name: "path/to/file",
193
-				Mode: 0700,
193
+				Mode: 0o700,
194 194
 			})
195 195
 			if err != nil {
196 196
 				return nil, err
... ...
@@ -244,7 +244,7 @@ func TestCopyFromContainer(t *testing.T) {
244 244
 
245 245
 			headercontent, err := json.Marshal(types.ContainerPathStat{
246 246
 				Name: "name",
247
-				Mode: 0700,
247
+				Mode: 0o700,
248 248
 			})
249 249
 			if err != nil {
250 250
 				return nil, err
... ...
@@ -267,7 +267,7 @@ func TestCopyFromContainer(t *testing.T) {
267 267
 	if stat.Name != "name" {
268 268
 		t.Fatalf("expected container path stat name to be 'name', got '%s'", stat.Name)
269 269
 	}
270
-	if stat.Mode != 0700 {
270
+	if stat.Mode != 0o700 {
271 271
 		t.Fatalf("expected container path stat mode to be 0700, got '%v'", stat.Mode)
272 272
 	}
273 273
 	content, err := io.ReadAll(r)
... ...
@@ -37,7 +37,6 @@ func (cli *Client) ContainerList(ctx context.Context, options types.ContainerLis
37 37
 	if options.Filters.Len() > 0 {
38 38
 		//nolint:staticcheck // ignore SA1019 for old code
39 39
 		filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters)
40
-
41 40
 		if err != nil {
42 41
 			return nil, err
43 42
 		}
... ...
@@ -16,7 +16,6 @@ func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions)
16 16
 
17 17
 	if options.Filters.Len() > 0 {
18 18
 		filterJSON, err := filters.ToJSON(options.Filters)
19
-
20 19
 		if err != nil {
21 20
 			return nil, err
22 21
 		}
... ...
@@ -194,7 +194,6 @@ func TestServiceCreateDigestPinning(t *testing.T) {
194 194
 				},
195 195
 			},
196 196
 		}, types.ServiceCreateOptions{QueryRegistry: true})
197
-
198 197
 		if err != nil {
199 198
 			t.Fatal(err)
200 199
 		}