mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:43:29 +00:00
refactored env variables handling
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/indig0fox/a3go/a3interface"
|
||||
@@ -23,7 +24,19 @@ func main() {
|
||||
func init() {
|
||||
fmt.Printf("Module Path Directory => " + modulePathDir)
|
||||
|
||||
godotenv.Load(".env")
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
fmt.Println("Error loading .env file:", err)
|
||||
} else {
|
||||
fmt.Println(".env file loaded successfully")
|
||||
}
|
||||
|
||||
FTS_URL := os.Getenv("FTS_URL")
|
||||
if FTS_URL == "" {
|
||||
fmt.Println("FTS_URL not found in environment variables or .env file (if used).")
|
||||
} else {
|
||||
fmt.Println("FTS URL:", FTS_URL)
|
||||
}
|
||||
|
||||
a3interface.SetVersion("0.0.0")
|
||||
a3interface.RegisterErrorChan(a3ErrorChannel)
|
||||
@@ -139,5 +152,4 @@ func init() {
|
||||
SetFunction(armatak_controller_ManageKML_postKML).
|
||||
SetArgsFunction(armatak_controller_args_ManageKML_postKML).
|
||||
Register()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user