initial commit

This commit is contained in:
Timon Ringwald
2020-09-09 11:48:46 +02:00
commit 4e5775fcfa
8 changed files with 292 additions and 0 deletions

28
utils.go Normal file
View File

@ -0,0 +1,28 @@
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)
}