mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 13:54:17 +02:00
use slices.Collect(maps.Keys()) to get map keys
This commit is contained in:
@@ -22,6 +22,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"codeberg.org/scip/esctl/pkg/cfg"
|
||||
@@ -62,13 +64,7 @@ func IlmNames(conf *cfg.Config) ([]string, error) {
|
||||
return nil, fmt.Errorf("failed to get ilm policies: %w", esErrorString(err))
|
||||
}
|
||||
|
||||
names := make([]string, len(res))
|
||||
idx := 0
|
||||
|
||||
for name := range res {
|
||||
names[idx] = name
|
||||
idx++
|
||||
}
|
||||
names := slices.Collect(maps.Keys(res))
|
||||
|
||||
return names, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user