Select correct lang in request, use timeout for request, fix sighandler panic
This commit is contained in:
@@ -3,6 +3,7 @@ package holy
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"tg-holy-bot/internal/log"
|
||||
@@ -103,6 +104,13 @@ func ReadConfig() error {
|
||||
return errors.New("Amount of user_agent strings in config must be exactly 31! Refusing to start") //nolint: staticcheck // Looks like golangci-lint ignoring settings about fucking ST1005 check. We want readable errors despite what wants author of linter or assholes from go dev team.
|
||||
}
|
||||
|
||||
// Validate that all user agent strings are non-empty
|
||||
for i, userAgent := range sampleConfig.UserAgents {
|
||||
if userAgent == "" {
|
||||
return fmt.Errorf("User agent string at index %d is empty! Refusing to start", i) //nolint: staticcheck // Looks like golangci-lint ignoring settings about fucking ST1005 check. We want readable errors despite what wants author of linter or assholes from go dev team.
|
||||
}
|
||||
}
|
||||
|
||||
log.Infof("Using %s as config file", location)
|
||||
|
||||
Config = sampleConfig
|
||||
|
||||
Reference in New Issue
Block a user