Reformat comments

This commit is contained in:
Zlatko Čalušić 2016-11-06 11:15:33 +01:00
parent d74e19b13d
commit 5de6d4fd00
11 changed files with 67 additions and 107 deletions

View file

@ -2,8 +2,7 @@ package errors
import "fmt"
// fatalError is an error that should be printed to the user, then the program
// should exit with an error code.
// fatalError is an error that should be printed to the user, then the program should exit with an error code.
type fatalError string
func (e fatalError) Error() string {
@ -14,14 +13,12 @@ func (e fatalError) Fatal() bool {
return true
}
// Fataler is an error which should be printed to the user directly.
// Afterwards, the program should exit with an error.
// Fataler is an error which should be printed to the user directly. Afterwards, the program should exit with an error.
type Fataler interface {
Fatal() bool
}
// IsFatal returns true if err is a fatal message that should be printed to the
// user. Then, the program should exit.
// IsFatal returns true if err is a fatal message that should be printed to the user. Then, the program should exit.
func IsFatal(err error) bool {
e, ok := err.(Fataler)
return ok && e.Fatal()