refactor: log parser names (again :))
This commit is contained in:
@@ -19,17 +19,19 @@ const (
|
||||
dashLength = 58
|
||||
)
|
||||
|
||||
func textWriter(w io.Writer, results []result) error {
|
||||
fmt.Fprintf(w, header, "DOMAINS", "PAGES", "VISITS", "UNIQUES")
|
||||
fmt.Fprintln(w, strings.Repeat("-", dashLength))
|
||||
func textWriter(w io.Writer) outputFunc {
|
||||
return func(results []result) error {
|
||||
fmt.Fprintf(w, header, "DOMAINS", "PAGES", "VISITS", "UNIQUES")
|
||||
fmt.Fprintln(w, strings.Repeat("-", dashLength))
|
||||
|
||||
var total result
|
||||
for _, r := range results {
|
||||
total = total.add(r)
|
||||
fmt.Fprintf(w, line, r.domain, r.page, r.visits, r.uniques)
|
||||
var total result
|
||||
for _, r := range results {
|
||||
total = total.add(r)
|
||||
fmt.Fprintf(w, line, r.domain, r.page, r.visits, r.uniques)
|
||||
}
|
||||
|
||||
fmt.Fprintf(w, footer, "", total.visits, total.uniques)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
fmt.Fprintf(w, footer, "", total.visits, total.uniques)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user