From 551f19531d5dc9cb924c4546bc757db96470ca1c Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Tue, 30 Sep 2014 08:50:12 -0500 Subject: [PATCH] Use descriptive const for readline history filename --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 1990e12a..58ff52d1 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,8 @@ type term struct { stdin *bufio.Reader } +const historyFile string = ".dbg_history" + func main() { // We must ensure here that we are running on the same thread during // the execution of dbg. This is due to the fact that ptrace(2) expects @@ -43,8 +45,7 @@ func main() { } dbgproc := beginTrace(pid, proc) - history := ".dbg_history" - goreadline.LoadHistoryFromFile(history) + goreadline.LoadHistoryFromFile(historyFile) for { cmdstr, err := t.promptForInput() @@ -55,7 +56,7 @@ func main() { cmdstr, args := parseCommand(cmdstr) if cmdstr == "exit" { - err := goreadline.WriteHistoryToFile(history) + err := goreadline.WriteHistoryToFile(historyFile) fmt.Println(err) handleExit(t, dbgproc, 0) }