diff --git a/cli/command/task/print.go b/cli/command/task/print.go index da9645b72c..4c9b362a2f 100644 --- a/cli/command/task/print.go +++ b/cli/command/task/print.go @@ -89,7 +89,8 @@ func Print(ctx context.Context, dockerCli command.Cli, tasks []swarm.Task, resol // Task-names are not unique in cases where "tasks" contains previous/rotated tasks. func generateTaskNames(ctx context.Context, tasks []swarm.Task, resolver *idresolver.IDResolver) ([]swarm.Task, error) { // Use a copy of the tasks list, to not modify the original slice - t := append(tasks[:0:0], tasks...) + // see https://github.com/go101/go101/wiki/How-to-efficiently-clone-a-slice%3F + t := append(tasks[:0:0], tasks...) //nolint:gocritic // ignore appendAssign: append result not assigned to the same slice for i, task := range t { serviceName, err := resolver.Resolve(ctx, swarm.Service{}, task.ServiceID) diff --git a/cli/command/trust/inspect.go b/cli/command/trust/inspect.go index d7370bd09d..980fb321c4 100644 --- a/cli/command/trust/inspect.go +++ b/cli/command/trust/inspect.go @@ -71,7 +71,7 @@ func getRepoTrustInfo(cli command.Cli, remote string) ([]byte, error) { // process the signatures to include repo admin if signed by the base targets role for idx, sig := range signatureRows { if len(sig.Signers) == 0 { - signatureRows[idx].Signers = append(sig.Signers, releasedRoleName) + signatureRows[idx].Signers = []string{releasedRoleName} } }