summaryrefslogtreecommitdiff
path: root/session.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2024-11-28 17:57:50 +0300
committerGrail Finder <wohilas@gmail.com>2024-11-28 17:57:50 +0300
commit34d415c9308f2d089520c2a193cdf8393dcc6b5d (patch)
treebac545ddb1859f18f7d9d75ef5dd23d8c7d29b90 /session.go
parent14d706f94a45ab43c51f9c03abea7b3588c571c7 (diff)
Feat: add linter
Diffstat (limited to 'session.go')
-rw-r--r--session.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/session.go b/session.go
index 7c035fa..ee448cc 100644
--- a/session.go
+++ b/session.go
@@ -3,6 +3,7 @@ package main
import (
"elefant/models"
"encoding/json"
+ "errors"
"fmt"
"os/exec"
"strings"
@@ -19,7 +20,7 @@ func historyToSJSON(msgs []models.MessagesStory) (string, error) {
return "", err
}
if data == nil {
- return "", fmt.Errorf("nil data")
+ return "", errors.New("nil data")
}
return string(data), nil
}
@@ -61,7 +62,7 @@ func loadHistoryChats() ([]string, error) {
func loadHistoryChat(chatName string) ([]models.MessagesStory, error) {
chat, ok := chatMap[chatName]
if !ok {
- err := fmt.Errorf("failed to read chat")
+ err := errors.New("failed to read chat")
logger.Error("failed to read chat", "name", chatName)
return nil, err
}