diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -6,8 +6,6 @@ package main import ( "fmt" - "strings" - "sort" "runtime" "time" "embed" @@ -182,20 +180,3 @@ func timeFunction(f func()) time.Duration { f() // Execute the function return time.Since(startTime) // Calculate the elapsed time } - -// sortLines takes a string, splits it on newlines, sorts the lines, -// and rejoins them with newlines. -func sortLines(input string) string { - lines := strings.Split(input, "\n") - - // Trim leading and trailing whitespace from each line - for i, line := range lines { - lines[i] = strings.TrimSpace(line) - } - - sort.Strings(lines) - tmp := strings.Join(lines, "\n") - tmp = strings.TrimLeft(tmp, "\n") - tmp = strings.TrimRight(tmp, "\n") - return tmp -} |
