Skip to content

Commit

Permalink
refactor(cli): remove unused removeSpacesAroundCommas function
Browse files Browse the repository at this point in the history
- Deleted the `removeSpacesAroundCommas` function as it is no longer needed
- Minor comment adjustment in `verifyReceiversGrouping` for consistency

This cleanup removes an unnecessary utility function and maintains code simplicity.
  • Loading branch information
heartwilltell committed Jan 28, 2025
1 parent 8bb4284 commit 2b33bb7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cli/test_routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,6 @@ func parseReceiversWithGrouping(input string) (map[string][]string, error) {
return flattenGroupingMap(result), nil
}

// removeSpacesAroundCommas removes spaces around commas.
func removeSpacesAroundCommas(input string) string {
input = strings.ReplaceAll(input, " ,", ",")
input = strings.ReplaceAll(input, ", ", ",")

return input
}

// flattenGroupingMap converts the internal map[string][][]string to the expected map[string][]string format.
func flattenGroupingMap(input map[string][][]string) map[string][]string {
result := make(map[string][]string)
Expand Down Expand Up @@ -295,7 +287,7 @@ func verifyReceiversGrouping(receiversGrouping map[string][]string, finalRoutes
continue
}

// Try to match with expected grouping
// Try to match with expected grouping.
if expectedGroups != nil {
sortedExpected := slices.Clone(expectedGroups)
sortedActual := slices.Clone(actualGroups)
Expand Down

0 comments on commit 2b33bb7

Please sign in to comment.