fix: warn when .env file is missing instead of silently ignoring
All checks were successful
CI / Deploy / test (pull_request) Successful in 13s
CI / Deploy / lint (pull_request) Successful in 24s
CI / Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
Ryan Hamamura
2026-03-02 12:42:10 -10:00
parent 67d4dba37f
commit fcc6b70e84

View File

@@ -4,6 +4,7 @@
package config package config
import ( import (
"log/slog"
"os" "os"
"sync" "sync"
@@ -46,7 +47,9 @@ func getEnv(key, fallback string) string {
} }
func loadBase() *Config { func loadBase() *Config {
godotenv.Load() //nolint:errcheck // .env file is optional if err := godotenv.Load(); err != nil {
slog.Warn("no .env file found, using environment variables and defaults")
}
return &Config{ return &Config{
Host: getEnv("HOST", "0.0.0.0"), Host: getEnv("HOST", "0.0.0.0"),