console: clearHistory() now returns an error

This commit is contained in:
Sorin Neacsu 2017-12-07 10:56:16 -08:00
parent b1534d1d14
commit c79f7a46e7

View file

@ -217,11 +217,10 @@ func (c *Console) init(preload []string) error {
return nil return nil
} }
func (c *Console) clearHistory() { func (c *Console) clearHistory() (err error) {
c.history = nil c.history = nil
c.prompter.ClearHistory() c.prompter.ClearHistory()
os.Remove(c.histPath) return os.Remove(c.histPath)
fmt.Fprintf(c.printer, "history cleared\n")
} }
// consoleOutput is an override for the console.log and console.error methods to // consoleOutput is an override for the console.log and console.error methods to