bugfix
All checks were successful
release-tag / release-image (push) Successful in 1m32s

This commit is contained in:
2025-09-24 12:00:44 +02:00
parent dc3abf661f
commit 629e8297b6

View File

@@ -9,6 +9,7 @@ import (
"os" "os"
"os/signal" "os/signal"
"path/filepath" "path/filepath"
"strconv"
"strings" "strings"
"syscall" "syscall"
"time" "time"
@@ -56,21 +57,15 @@ func envBool(k string) bool {
v := strings.ToLower(os.Getenv(k)) v := strings.ToLower(os.Getenv(k))
return v == "1" || v == "true" || v == "yes" return v == "1" || v == "true" || v == "yes"
} }
func envInt64(k string, def int64) int64 { func envInt64(k string, def int64) int64 {
if v := os.Getenv(k); v != "" { if v := os.Getenv(k); v != "" {
var x int64 if x, err := strconv.ParseInt(v, 10, 64); err == nil {
_, _ = fmtSscanf(v, &x)
return x return x
} }
}
return def return def
} }
func fmtSscanf(s string, p *int64) (int, error) { return fmtSscanfImpl(s, p) }
// tiny wrapper to avoid importing fmt at top-level; keeps imports tidy
func fmtSscanfImpl(s string, p *int64) (int, error) { return fmtSscanfReal(s, p) }
//go:linkname fmtSscanfReal fmt.Sscanf
func fmtSscanfReal(s string, p *int64) (int, error)
func loadConfig() Config { func loadConfig() Config {
cfg := Config{ cfg := Config{