diff --git a/cmd/restic/global.go b/cmd/restic/global.go index ef69eabc3..bfb8ba9e8 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -232,7 +232,7 @@ func Warnf(format string, args ...interface{}) { // Exitf uses Warnf to write the message and then terminates the process with // the given exit code. func Exitf(exitcode int, format string, args ...interface{}) { - if format[len(format)-1] != '\n' { + if !(strings.HasSuffix(format, "\n")) { format += "\n" }