diff options
Diffstat (limited to 'util.go')
| -rw-r--r-- | util.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 { |
