feat: load optional .env file and add .env.example

This commit is contained in:
maishivamhoo123
2025-12-23 14:17:38 +05:30
committed by LinkinStars
parent 5ff6106d37
commit 1fbb802e8f
52 changed files with 86392 additions and 0 deletions
+6
View File
@@ -31,12 +31,18 @@ import (
"github.com/apache/answer/internal/base/path"
"github.com/apache/answer/internal/schema"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"github.com/segmentfault/pacman"
"github.com/segmentfault/pacman/contrib/log/zap"
"github.com/segmentfault/pacman/contrib/server/http"
"github.com/segmentfault/pacman/log"
)
func init() {
// Load .env if present, ignore error to keep backward compatibility
_ = godotenv.Load()
}
// go build -ldflags "-X github.com/apache/answer/cmd.Version=x.y.z"
var (
// Name is the name of the project