status-go/vendor/github.com/anacrolix/missinggo/croak.go

19 lines
243 B
Go
Raw Permalink Normal View History

2022-03-10 09:44:48 +00:00
package missinggo
import (
"fmt"
"os"
)
func Unchomp(s string) string {
if len(s) > 0 && s[len(s)-1] == '\n' {
return s
}
return s + "\n"
}
func Fatal(msg interface{}) {
os.Stderr.WriteString(Unchomp(fmt.Sprint(msg)))
os.Exit(1)
}