YTSFlix_Go/vendor/github.com/anacrolix/missinggo/croak.go

19 lines
243 B
Go
Raw Normal View History

2018-11-04 14:58:15 +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)
}