Skip to content

Commit c4d8572

Browse files
committed
removed unnecessary return
1 parent e9caed5 commit c4d8572

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

sorted.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import (
55
"sort"
66
)
77

8-
func sorted(arr []string, lang string) []string {
8+
func sorted(arr []string, lang string) {
99
less := collate.IndexString(lang)
1010
sort.SliceStable(arr, func(i, j int) bool {
1111
return less(arr[i], arr[j])
1212
})
13-
return arr
1413
}

sorted_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ func TestSorted(t *testing.T) {
99
arr := []string{"b", "ą", "ć", "c", "a", "ż", "ś"}
1010

1111
expected := []string{"a", "ą", "b", "c", "ć", "ś", "ż"}
12-
given := sorted(arr, "POLISH_CI")
12+
sorted(arr, "POLISH_CI")
1313

14-
if strings.Join(given, ",") != strings.Join(expected, ",") {
15-
t.Errorf("Expected %v, but got %v", expected, given)
14+
if strings.Join(arr, ",") != strings.Join(expected, ",") {
15+
t.Errorf("Expected %v, but got %v", expected, arr)
1616
}
1717

1818
}

0 commit comments

Comments
 (0)