Skip to content

Commit a0eab8e

Browse files
committed
Fixed function names to be intuitive
1 parent c2790c8 commit a0eab8e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

internal/exercises/solutions/32_sorting/sorting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
var Years = []int{2017, 2003, 2026}
88
var Pets = []string{"Dog", "Cat", "Parrot"}
99

10-
func SortNumbers() []int {
10+
func SortYears() []int {
1111
slices.Sort(Years)
1212
return Years
1313
}
1414

15-
func SortAnimals() []string {
15+
func SortPets() []string {
1616
slices.Sort(Pets)
1717
return Pets
1818
}

internal/exercises/templates/32_sorting/sorting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package sorting
33
var Years = []int{2017, 2003, 2026}
44
var Pets = []string{"Dog", "Cat", "Parrot"}
55

6-
func SortNumbers() []int {
6+
func SortYears() []int {
77
return Years
88
}
99

10-
func SortAnimals() []string {
10+
func SortPets() []string {
1111
return Pets
1212
}

internal/exercises/templates/32_sorting/sorting_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77

88
func TestSorting(t *testing.T) {
99
t.Run("Sorting numbers", func(t *testing.T) {
10-
SortNumbers()
10+
SortYears()
1111
if !slices.IsSorted(Years) {
1212
t.Fatal("Strings are not sorted!")
1313
}
1414
})
1515

1616
t.Run("Sorting strings", func(t *testing.T) {
17-
SortAnimals()
17+
SortPets()
1818
if !slices.IsSorted(Pets) {
1919
t.Fatal("Strings are not sorted!")
2020
}

0 commit comments

Comments
 (0)