From 4e54219efbaffa645dab4036b73a7b6cd4a529d8 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Tue, 21 Mar 2023 14:24:53 -0400 Subject: [PATCH] print newline when panicking --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 33b621a..598c0f6 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ func main() { } if err := os.MkdirAll(dataPath, 0755); err != nil { - log.Panicf("Failed to create datapath, path: %s, err: %s", dataPath, err) + log.Panicf("Failed to create datapath, path: %s, err: %s\n", dataPath, err) } return dataPath }() @@ -67,7 +67,7 @@ func main() { var chats sync.Map if err := loadData(dataPath, &chats); err != nil { - log.Panicf("failed to load data, err: %s", err) + log.Panicf("failed to load data, err: %s\n", err) } botPath := fmt.Sprintf("/bot%s", apiToken) http.HandleFunc(botPath, func(w http.ResponseWriter, r *http.Request) { @@ -131,7 +131,7 @@ func main() { } }) - log.Panic(http.ListenAndServe(fmt.Sprintf(":%v", port), nil)) + log.Panicln(http.ListenAndServe(fmt.Sprintf(":%v", port), nil)) } func handleTextAdded(gl *glist.GList, text string) {