Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions internal/manifest/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package manifest

import (
"encoding/json"
"sort"
"strings"

"github.com/slackapi/slack-cli/internal/slackerror"
Expand Down Expand Up @@ -69,13 +68,3 @@ func escapePathSegment(s string) string {
s = strings.ReplaceAll(s, `.`, `\.`)
return s
}

// SortedKeys returns the keys of a flat map in sorted order for deterministic output.
func SortedKeys(m map[string]any) []string {
keys := make([]string, 0, len(m))
for k := range m {
keys = append(keys, k)
}
sort.Strings(keys)
return keys
}
10 changes: 0 additions & 10 deletions internal/manifest/flatten_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,3 @@ func Test_Flatten_DottedKeyRoundTrip(t *testing.T) {
assert.Equal(t, "Lookup", round.Functions["slack.users.lookup"].Title)
assert.Equal(t, "Lookup a user", round.Functions["slack.users.lookup"].Description)
}

func Test_SortedKeys(t *testing.T) {
m := map[string]any{
"z.field": "val",
"a.field": "val",
"m.field": "val",
}
keys := SortedKeys(m)
assert.Equal(t, []string{"a.field", "m.field", "z.field"}, keys)
}
Loading