aboutsummaryrefslogtreecommitdiff
path: root/log.go
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-03-31 00:50:32 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-03-31 00:50:32 +0900
commit0ec0770ef2d510ff23f2ea1d5405cee174ee0b5a (patch)
tree11dda40142e9e36f4574a8271260ff85304ec472 /log.go
parent5971b4bd57f43b742948cc5880c60d9439f40230 (diff)
downloadkati-0ec0770ef2d510ff23f2ea1d5405cee174ee0b5a.tar.gz
Fix the error message for "missing separator"
Diffstat (limited to 'log.go')
-rw-r--r--log.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/log.go b/log.go
index 6d931e8..6f39cc6 100644
--- a/log.go
+++ b/log.go
@@ -3,6 +3,7 @@ package main
import (
"bytes"
"fmt"
+ "os"
)
func Log(f string, a ...interface{}) {
@@ -18,11 +19,8 @@ func Warn(filename string, lineno int, f string, a ...interface{}) {
fmt.Printf(f, a...)
}
-func Error(f string, a ...interface{}) {
- var buf bytes.Buffer
- buf.WriteString("error: ")
- buf.WriteString(f)
- buf.WriteByte('\n')
- fmt.Printf(buf.String(), a...)
- panic("")
+func Error(filename string, lineno int, f string, a ...interface{}) {
+ f = fmt.Sprintf("%s:%d: %s\n", filename, lineno, f)
+ fmt.Printf(f, a...)
+ os.Exit(2)
}