Check for history file errors as well

This commit is contained in:
Daniel Nagy 2021-06-08 11:01:23 +02:00
parent 492a91e0b0
commit 7ce3bee0c0
No known key found for this signature in database
GPG key ID: 1B8E8DCB576FB671

View file

@ -148,9 +148,11 @@ func loadHistory() {
func saveHistory() {
if f, err := os.Create(historyPath); err != nil {
fmt.Printf("Error writing history file: %v\n", err)
fmt.Printf("Error creating history file: %v\n", err)
} else {
line.WriteHistory(f)
if _, err = line.WriteHistory(f); err != nil {
fmt.Printf("Error writing history file: %v\n", err)
}
f.Close()
}
}