Changed GoConfig to UsrConfig
Changed GoConfig struct to UsrConfig
This commit is contained in:
@@ -9,14 +9,14 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func readCfg(factCfg string) GoConfig {
|
||||
func readCfg(factCfg string) UsrConfig {
|
||||
//read config file (YAML)
|
||||
fileBytes, err := os.ReadFile(factCfg)
|
||||
if err != nil {
|
||||
log.Fatalf("Error reading config file: %v", err)
|
||||
}
|
||||
// return Struct
|
||||
var config GoConfig
|
||||
var config UsrConfig
|
||||
err = yaml.Unmarshal(fileBytes, &config)
|
||||
if err != nil {
|
||||
log.Fatalf("Error unmarshalling YAML file: %v", err)
|
||||
@@ -32,7 +32,7 @@ func isItReal(path string) bool { //check if path exists
|
||||
return false
|
||||
}
|
||||
}
|
||||
func verifyConfig(config GoConfig) bool { // check each file/dir to see if it exists
|
||||
func verifyConfig(config UsrConfig) bool { // check each file/dir to see if it exists
|
||||
if !isItReal(config.Server.ServDir) { //check for Server directory
|
||||
fmt.Printf("PATH NOT FOUND: %s", config.Server.ServDir)
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user