Improve Reporter interface

This commit is contained in:
Tomás Senart
2013-09-22 17:44:57 +02:00
parent 0bc9d0ccbe
commit f0579e67e4
2 changed files with 27 additions and 17 deletions

View File

@@ -48,6 +48,7 @@ func report(reporter, input, output string) error {
}
all = append(all, results...)
}
all.Sort()
out, err := file(output, true)
if err != nil {
@@ -55,7 +56,9 @@ func report(reporter, input, output string) error {
}
defer out.Close()
if err := rep(all.Sort(), out); err != nil {
if data, err := rep(all); err != nil {
return err
} else if _, err := out.Write(data); err != nil {
return err
}