1
0
mirror of https://github.com/axzilla/templui.git synced 2025-02-22 13:22:38 +00:00
templui/internal/config/config.go

29 lines
351 B
Go

package config
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
)
type Config struct {
GoEnv string
}
var AppConfig *Config
func LoadConfig() {
err := godotenv.Load()
if err != nil {
fmt.Println("Error loading .env file")
} else {
log.Println(".env file initialized.")
}
AppConfig = &Config{
GoEnv: os.Getenv("GO_ENV"),
}
}