mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:33:29 +00:00
refactored env variables handling
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/indig0fox/a3go/a3interface"
|
"github.com/indig0fox/a3go/a3interface"
|
||||||
@@ -23,7 +24,19 @@ func main() {
|
|||||||
func init() {
|
func init() {
|
||||||
fmt.Printf("Module Path Directory => " + modulePathDir)
|
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.SetVersion("0.0.0")
|
||||||
a3interface.RegisterErrorChan(a3ErrorChannel)
|
a3interface.RegisterErrorChan(a3ErrorChannel)
|
||||||
@@ -139,5 +152,4 @@ func init() {
|
|||||||
SetFunction(armatak_controller_ManageKML_postKML).
|
SetFunction(armatak_controller_ManageKML_postKML).
|
||||||
SetArgsFunction(armatak_controller_args_ManageKML_postKML).
|
SetArgsFunction(armatak_controller_args_ManageKML_postKML).
|
||||||
Register()
|
Register()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user