25 lines
455 B
Go
25 lines
455 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"mailq-inspector/parser"
|
||
|
)
|
||
|
|
||
|
|
||
|
func main() {
|
||
|
// Read data from stdin
|
||
|
scanner := bufio.NewScanner(os.Stdin)
|
||
|
entries, err := parser.ParseMailQ(scanner)
|
||
|
if err != nil {
|
||
|
fmt.Printf("Got error from parser: %s\n", err.Error())
|
||
|
os.Exit(1)
|
||
|
} else {
|
||
|
for _, entry := range entries {
|
||
|
fmt.Printf("%s\n", entry.String())
|
||
|
}
|
||
|
os.Exit(0)
|
||
|
}
|
||
|
}
|