diff --git a/client/image_history_test.go b/client/image_history_test.go index 484b435e89..e0df6f7e60 100644 --- a/client/image_history_test.go +++ b/client/image_history_test.go @@ -46,7 +46,8 @@ func TestImageHistory(t *testing.T) { ID: "image_id2", Tags: []string{"tag1", "tag2"}, }, - }} + }, + } imageHistories, err := client.ImageHistory(context.Background(), "image_id", ImageHistoryWithPlatform(ocispec.Platform{ Architecture: "arm64", diff --git a/client/image_pull.go b/client/image_pull.go index 83d6512829..f111adc102 100644 --- a/client/image_pull.go +++ b/client/image_pull.go @@ -23,10 +23,10 @@ type ImagePullResponse interface { // It executes the privileged function if the operation is unauthorized // and it tries one more time. // Callers can: -// - use [ImagePullResponse.Wait] to wait for pull to complete -// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence -// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case. -// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing. +// - use [ImagePullResponse.Wait] to wait for pull to complete +// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence +// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case. +// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing. func (cli *Client) ImagePull(ctx context.Context, refStr string, options ImagePullOptions) (ImagePullResponse, error) { // FIXME(vdemeester): there is currently used in a few way in docker/docker // - if not in trusted content, ref is used to pass the whole reference, and tag is empty diff --git a/client/image_push.go b/client/image_push.go index 2643fb2061..b50e1dd3f3 100644 --- a/client/image_push.go +++ b/client/image_push.go @@ -27,10 +27,10 @@ type ImagePushResponse interface { // It executes the privileged function if the operation is unauthorized // and it tries one more time. // Callers can -// - use [ImagePushResponse.Wait] to wait for push to complete -// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence -// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case. -// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing. +// - use [ImagePushResponse.Wait] to wait for push to complete +// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence +// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case. +// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing. func (cli *Client) ImagePush(ctx context.Context, image string, options ImagePushOptions) (ImagePushResponse, error) { ref, err := reference.ParseNormalizedNamed(image) if err != nil { diff --git a/client/node_remove.go b/client/node_remove.go index d70aac88cc..c7f6d7ea8a 100644 --- a/client/node_remove.go +++ b/client/node_remove.go @@ -5,8 +5,7 @@ import ( "net/url" ) -type NodeRemoveResult struct { -} +type NodeRemoveResult struct{} // NodeRemove removes a Node. func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options NodeRemoveOptions) (NodeRemoveResult, error) { diff --git a/client/node_update.go b/client/node_update.go index 54c26811c8..8f9caa4411 100644 --- a/client/node_update.go +++ b/client/node_update.go @@ -5,8 +5,7 @@ import ( "net/url" ) -type NodeUpdateResult struct { -} +type NodeUpdateResult struct{} // NodeUpdate updates a Node. func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, options NodeUpdateOptions) (NodeUpdateResult, error) { diff --git a/client/pkg/jsonmessage/jsonmessage.go b/client/pkg/jsonmessage/jsonmessage.go index 3820bcbaff..1c661e9705 100644 --- a/client/pkg/jsonmessage/jsonmessage.go +++ b/client/pkg/jsonmessage/jsonmessage.go @@ -195,7 +195,7 @@ type JSONMessagesStream iter.Seq2[JSONMessage, error] // each [JSONMessage] to out. // see DisplayJSONMessages for details func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error { - var dec = json.NewDecoder(in) + dec := json.NewDecoder(in) var f JSONMessagesStream = func(yield func(JSONMessage, error) bool) { for { var jm JSONMessage @@ -229,7 +229,7 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, // called if a JSONMessage contains an Aux field, in which case // DisplayJSONMessagesStream does not present the JSONMessage. func DisplayJSONMessages(messages JSONMessagesStream, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error { - var ids = make(map[string]uint) + ids := make(map[string]uint) for jm, err := range messages { var diff uint diff --git a/client/swarm_node_inspect_opts.go b/client/swarm_node_inspect_opts.go index 197e495fb7..5423f5c67c 100644 --- a/client/swarm_node_inspect_opts.go +++ b/client/swarm_node_inspect_opts.go @@ -1,5 +1,4 @@ package client // NodeInspectOptions holds parameters to inspect nodes with. -type NodeInspectOptions struct { -} +type NodeInspectOptions struct{} diff --git a/vendor/github.com/moby/moby/client/image_pull.go b/vendor/github.com/moby/moby/client/image_pull.go index 83d6512829..f111adc102 100644 --- a/vendor/github.com/moby/moby/client/image_pull.go +++ b/vendor/github.com/moby/moby/client/image_pull.go @@ -23,10 +23,10 @@ type ImagePullResponse interface { // It executes the privileged function if the operation is unauthorized // and it tries one more time. // Callers can: -// - use [ImagePullResponse.Wait] to wait for pull to complete -// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence -// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case. -// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing. +// - use [ImagePullResponse.Wait] to wait for pull to complete +// - use [ImagePullResponse.JSONMessages] to monitor pull progress as a sequence +// of JSONMessages, [ImagePullResponse.Close] does not need to be called in this case. +// - use the [io.Reader] interface and call [ImagePullResponse.Close] after processing. func (cli *Client) ImagePull(ctx context.Context, refStr string, options ImagePullOptions) (ImagePullResponse, error) { // FIXME(vdemeester): there is currently used in a few way in docker/docker // - if not in trusted content, ref is used to pass the whole reference, and tag is empty diff --git a/vendor/github.com/moby/moby/client/image_push.go b/vendor/github.com/moby/moby/client/image_push.go index 2643fb2061..b50e1dd3f3 100644 --- a/vendor/github.com/moby/moby/client/image_push.go +++ b/vendor/github.com/moby/moby/client/image_push.go @@ -27,10 +27,10 @@ type ImagePushResponse interface { // It executes the privileged function if the operation is unauthorized // and it tries one more time. // Callers can -// - use [ImagePushResponse.Wait] to wait for push to complete -// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence -// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case. -// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing. +// - use [ImagePushResponse.Wait] to wait for push to complete +// - use [ImagePushResponse.JSONMessages] to monitor pull progress as a sequence +// of JSONMessages, [ImagePushResponse.Close] does not need to be called in this case. +// - use the [io.Reader] interface and call [ImagePushResponse.Close] after processing. func (cli *Client) ImagePush(ctx context.Context, image string, options ImagePushOptions) (ImagePushResponse, error) { ref, err := reference.ParseNormalizedNamed(image) if err != nil { diff --git a/vendor/github.com/moby/moby/client/node_remove.go b/vendor/github.com/moby/moby/client/node_remove.go index d70aac88cc..c7f6d7ea8a 100644 --- a/vendor/github.com/moby/moby/client/node_remove.go +++ b/vendor/github.com/moby/moby/client/node_remove.go @@ -5,8 +5,7 @@ import ( "net/url" ) -type NodeRemoveResult struct { -} +type NodeRemoveResult struct{} // NodeRemove removes a Node. func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options NodeRemoveOptions) (NodeRemoveResult, error) { diff --git a/vendor/github.com/moby/moby/client/node_update.go b/vendor/github.com/moby/moby/client/node_update.go index 54c26811c8..8f9caa4411 100644 --- a/vendor/github.com/moby/moby/client/node_update.go +++ b/vendor/github.com/moby/moby/client/node_update.go @@ -5,8 +5,7 @@ import ( "net/url" ) -type NodeUpdateResult struct { -} +type NodeUpdateResult struct{} // NodeUpdate updates a Node. func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, options NodeUpdateOptions) (NodeUpdateResult, error) { diff --git a/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go b/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go index 3820bcbaff..1c661e9705 100644 --- a/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go +++ b/vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go @@ -195,7 +195,7 @@ type JSONMessagesStream iter.Seq2[JSONMessage, error] // each [JSONMessage] to out. // see DisplayJSONMessages for details func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error { - var dec = json.NewDecoder(in) + dec := json.NewDecoder(in) var f JSONMessagesStream = func(yield func(JSONMessage, error) bool) { for { var jm JSONMessage @@ -229,7 +229,7 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr, // called if a JSONMessage contains an Aux field, in which case // DisplayJSONMessagesStream does not present the JSONMessage. func DisplayJSONMessages(messages JSONMessagesStream, out io.Writer, terminalFd uintptr, isTerminal bool, auxCallback func(JSONMessage)) error { - var ids = make(map[string]uint) + ids := make(map[string]uint) for jm, err := range messages { var diff uint diff --git a/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go b/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go index 197e495fb7..5423f5c67c 100644 --- a/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go +++ b/vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go @@ -1,5 +1,4 @@ package client // NodeInspectOptions holds parameters to inspect nodes with. -type NodeInspectOptions struct { -} +type NodeInspectOptions struct{}