fix: load .env in local development

This commit is contained in:
zouyiyi
2026-05-06 21:09:12 +08:00
parent e6f5348278
commit e96bd1ed6d
3 changed files with 12 additions and 4 deletions

View File

@@ -12,9 +12,16 @@ import (
"os"
"strconv"
"time"
"github.com/joho/godotenv"
)
func main() {
// 加载 .env本地开发
if err := godotenv.Load(); err != nil {
log.Println(".env not found; continuing")
}
// 加载配置
configPath := os.Getenv("CONFIG_PATH")
if configPath == "" {