Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 3427ed8

Browse files
Update commands/backend.go
Co-authored-by: Dorin-Andrei Geman <[email protected]>
1 parent 7e1bc2f commit 3427ed8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

commands/backend.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@ var ValidBackends = map[string]bool{
1616
// validateBackend checks if the provided backend is valid
1717
func validateBackend(backend string) error {
1818
if !ValidBackends[backend] {
19-
keys := make([]string, 0, len(ValidBackends))
20-
for k := range ValidBackends {
21-
keys = append(keys, k)
22-
}
2319
return fmt.Errorf("invalid backend '%s'. Valid backends are: %s",
24-
backend, strings.Join(keys, ", "))
20+
backend, strings.Join(slices.Collect(maps.Keys(ValidBackends)), ", "))
2521
}
2622
return nil
2723
}

0 commit comments

Comments
 (0)