Sfoglia il codice sorgente

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 3 anni fa
parent
commit
0af6d9e291

+ 0 - 1
client/checkpoint_create_test.go

@@ -67,7 +67,6 @@ func TestCheckpointCreate(t *testing.T) {
 		CheckpointID: expectedCheckpointID,
 		CheckpointID: expectedCheckpointID,
 		Exit:         true,
 		Exit:         true,
 	})
 	})
-
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}

+ 0 - 1
client/checkpoint_delete_test.go

@@ -48,7 +48,6 @@ func TestCheckpointDelete(t *testing.T) {
 	err := client.CheckpointDelete(context.Background(), "container_id", types.CheckpointDeleteOptions{
 	err := client.CheckpointDelete(context.Background(), "container_id", types.CheckpointDeleteOptions{
 		CheckpointID: "checkpoint_id",
 		CheckpointID: "checkpoint_id",
 	})
 	})
-
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}

+ 5 - 5
client/container_copy_test.go

@@ -66,7 +66,7 @@ func TestContainerStatPath(t *testing.T) {
 			}
 			}
 			content, err := json.Marshal(types.ContainerPathStat{
 			content, err := json.Marshal(types.ContainerPathStat{
 				Name: "name",
 				Name: "name",
-				Mode: 0700,
+				Mode: 0o700,
 			})
 			})
 			if err != nil {
 			if err != nil {
 				return nil, err
 				return nil, err
@@ -88,7 +88,7 @@ func TestContainerStatPath(t *testing.T) {
 	if stat.Name != "name" {
 	if stat.Name != "name" {
 		t.Fatalf("expected container path stat name to be 'name', got '%s'", stat.Name)
 		t.Fatalf("expected container path stat name to be 'name', got '%s'", stat.Name)
 	}
 	}
-	if stat.Mode != 0700 {
+	if stat.Mode != 0o700 {
 		t.Fatalf("expected container path stat mode to be 0700, got '%v'", stat.Mode)
 		t.Fatalf("expected container path stat mode to be 0700, got '%v'", stat.Mode)
 	}
 	}
 }
 }
@@ -190,7 +190,7 @@ func TestCopyFromContainerEmptyResponse(t *testing.T) {
 		client: newMockClient(func(req *http.Request) (*http.Response, error) {
 		client: newMockClient(func(req *http.Request) (*http.Response, error) {
 			content, err := json.Marshal(types.ContainerPathStat{
 			content, err := json.Marshal(types.ContainerPathStat{
 				Name: "path/to/file",
 				Name: "path/to/file",
-				Mode: 0700,
+				Mode: 0o700,
 			})
 			})
 			if err != nil {
 			if err != nil {
 				return nil, err
 				return nil, err
@@ -244,7 +244,7 @@ func TestCopyFromContainer(t *testing.T) {
 
 
 			headercontent, err := json.Marshal(types.ContainerPathStat{
 			headercontent, err := json.Marshal(types.ContainerPathStat{
 				Name: "name",
 				Name: "name",
-				Mode: 0700,
+				Mode: 0o700,
 			})
 			})
 			if err != nil {
 			if err != nil {
 				return nil, err
 				return nil, err
@@ -267,7 +267,7 @@ func TestCopyFromContainer(t *testing.T) {
 	if stat.Name != "name" {
 	if stat.Name != "name" {
 		t.Fatalf("expected container path stat name to be 'name', got '%s'", stat.Name)
 		t.Fatalf("expected container path stat name to be 'name', got '%s'", stat.Name)
 	}
 	}
-	if stat.Mode != 0700 {
+	if stat.Mode != 0o700 {
 		t.Fatalf("expected container path stat mode to be 0700, got '%v'", stat.Mode)
 		t.Fatalf("expected container path stat mode to be 0700, got '%v'", stat.Mode)
 	}
 	}
 	content, err := io.ReadAll(r)
 	content, err := io.ReadAll(r)

+ 0 - 1
client/container_list.go

@@ -37,7 +37,6 @@ func (cli *Client) ContainerList(ctx context.Context, options types.ContainerLis
 	if options.Filters.Len() > 0 {
 	if options.Filters.Len() > 0 {
 		//nolint:staticcheck // ignore SA1019 for old code
 		//nolint:staticcheck // ignore SA1019 for old code
 		filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters)
 		filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters)
-
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
 		}
 		}

+ 0 - 1
client/node_list.go

@@ -16,7 +16,6 @@ func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions)
 
 
 	if options.Filters.Len() > 0 {
 	if options.Filters.Len() > 0 {
 		filterJSON, err := filters.ToJSON(options.Filters)
 		filterJSON, err := filters.ToJSON(options.Filters)
-
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
 		}
 		}

+ 0 - 1
client/service_create_test.go

@@ -194,7 +194,6 @@ func TestServiceCreateDigestPinning(t *testing.T) {
 				},
 				},
 			},
 			},
 		}, types.ServiceCreateOptions{QueryRegistry: true})
 		}, types.ServiceCreateOptions{QueryRegistry: true})
-
 		if err != nil {
 		if err != nil {
 			t.Fatal(err)
 			t.Fatal(err)
 		}
 		}