Skip to content

Commit

Permalink
Use maps.Keys
Browse files Browse the repository at this point in the history
Requires go 1.23.

Fixes #15.
  • Loading branch information
stefanvanburen committed Sep 5, 2024
1 parent b1b0d2e commit 89c3c0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cmd/small/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"flag"
"fmt"
"io"
"maps"
"os"
"slices"
"strings"
Expand Down Expand Up @@ -45,10 +46,7 @@ SUPPORTED TRANSFORMS

// sort the list of supported transforms, for stable output
supportedTransforms := small.SupportedTransformations()
supportedTransformNames := make([]string, 0, len(supportedTransforms))
for supportedTransformName := range supportedTransforms {
supportedTransformNames = append(supportedTransformNames, supportedTransformName)
}
supportedTransformNames := slices.Collect(maps.Keys(supportedTransforms))
slices.Sort(supportedTransformNames)

tabWriter := tabwriter.NewWriter(&usage, 0, 0, 1, ' ', 0)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/stefanvanburen/small

go 1.21.0
go 1.23.0

require github.com/peterbourgon/ff/v3 v3.4.0

0 comments on commit 89c3c0c

Please sign in to comment.