Innitial Commit
+added Base Project Version 0.0.1
This commit is contained in:
20
internal/config/config.go
Normal file
20
internal/config/config.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"pdev-ssh/internal/models"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func LoadConfig(path string) (models.AppConfig, error) {
|
||||
var cfg models.AppConfig
|
||||
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
|
||||
err = yaml.Unmarshal(data, &cfg)
|
||||
return cfg, err
|
||||
}
|
||||
Reference in New Issue
Block a user