31 lines
426 B
Go
31 lines
426 B
Go
package utils
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
// HandleError no blocking errors
|
|
func HandleError(err error) {
|
|
if err != nil {
|
|
log.Println(err)
|
|
}
|
|
}
|
|
|
|
// HandleFatalError fatal errors
|
|
func HandleFatalError(err error) {
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
os.Exit(2)
|
|
}
|
|
}
|
|
|
|
// Usage displays possible arguments
|
|
func Usage() {
|
|
fmt.Fprintf(os.Stderr, "Usage: getimap [inputfile]\n")
|
|
flag.PrintDefaults()
|
|
os.Exit(1)
|
|
}
|