File: croak.go

package info (click to toggle)
golang-github-anacrolix-missinggo 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 836 kB
  • sloc: makefile: 4
file content (18 lines) | stat: -rw-r--r-- 243 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
}