client: format code with gofumpt

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-01-20 13:49:39 +01:00
parent 3146ecbae6
commit 0af6d9e291
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
6 changed files with 5 additions and 10 deletions

View file

@ -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)
} }

View file

@ -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)
} }

View file

@ -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)

View file

@ -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
} }

View file

@ -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
} }

View file

@ -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)
} }