adverr/utils.go

29 lines
636 B
Go
Raw Normal View History

2020-09-09 11:48:46 +02:00
package adverr
import (
"fmt"
"os"
)
// Println prints the given err to stderr followed by a newline
func Println(err error) {
fmt.Fprintln(os.Stderr, err)
}
// Print prints the given err to stderr
func Print(err error) {
fmt.Fprint(os.Stderr, err)
}
// Fatalln prints the given err to stderr followed by a newline and exits immediately with the given exit code
func Fatalln(err error, exitcode int) {
fmt.Fprintln(os.Stderr, err)
os.Exit(exitcode)
}
// Fatal prints the given err to stderr and exits immediately with the given exit code
func Fatal(err error, exitcode int) {
fmt.Fprint(os.Stderr, err)
os.Exit(exitcode)
}