update go mod, remove tls insecure skip verifies

This commit is contained in:
2026-05-28 20:02:54 +00:00
parent c177f7d45b
commit b0bcaf61a2
6 changed files with 33 additions and 24 deletions
+14 -5
View File
@@ -2,6 +2,7 @@ package app
import (
"encoding/json"
"log"
"os"
)
@@ -34,15 +35,23 @@ type Config struct {
PVE PVEConfig `json:"pve"`
}
func GetConfig(configPath string) (Config, error) {
content, err := os.ReadFile(configPath)
func GetConfig(configPath string) Config {
root, err := os.OpenRoot(".")
if err != nil {
return Config{}, err
log.Fatal("Error when opening root dir: ", err)
}
defer root.Close()
content, err := root.ReadFile(configPath)
if err != nil {
log.Fatal("Error when opening config file: ", err)
}
var config Config
err = json.Unmarshal(content, &config)
if err != nil {
return Config{}, err
log.Fatal("Error during parsing config file: ", err)
}
return config, nil
return config
}