lint: modernize fix
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -869,9 +869,9 @@ func printTable(w io.Writer, kvs []keyValueOutput, title string) {
|
||||
func readKeyValues(attrs map[string]string, prefix string) []keyValueOutput {
|
||||
var out []keyValueOutput
|
||||
for k, v := range attrs {
|
||||
if strings.HasPrefix(k, prefix) {
|
||||
if name, ok := strings.CutPrefix(k, prefix); ok {
|
||||
out = append(out, keyValueOutput{
|
||||
Name: strings.TrimPrefix(k, prefix),
|
||||
Name: name,
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ func runRm(ctx context.Context, dockerCli command.Cli, opts rmOptions) error {
|
||||
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
for i, node := range nodes {
|
||||
node := node
|
||||
eg.Go(func() error {
|
||||
if node.Driver == nil {
|
||||
return nil
|
||||
|
||||
@@ -139,7 +139,6 @@ func queryRecords(ctx context.Context, ref string, nodes []builder.Node, opts *q
|
||||
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
for _, node := range nodes {
|
||||
node := node
|
||||
eg.Go(func() error {
|
||||
if node.Driver == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user