aboutsummaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'util.go')
-rw-r--r--util.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/util.go b/util.go
index a1cea5f..24a1693 100644
--- a/util.go
+++ b/util.go
@@ -22,9 +22,16 @@ import (
"bufio"
"fmt"
"os"
+ "sort"
"strings"
)
+//ShowSorted sorts the given lines and prints them on stdout.
+func ShowSorted(lines []string) {
+ sort.Strings(lines)
+ fmt.Println(strings.Join(lines, "\n"))
+}
+
//ShowError prints the given error on stderr if it is non-nil, or returns false otherwise.
func ShowError(err error) bool {
if err == nil {