|
|
|
@ -9,22 +9,9 @@ import (
|
|
|
|
|
"uploader/utils/storage"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const FilePath = "config.yaml"
|
|
|
|
|
|
|
|
|
|
func InitConfig() *config.Config {
|
|
|
|
|
currentDir, err := os.Getwd()
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt.Println("currentDir: " + currentDir)
|
|
|
|
|
|
|
|
|
|
filePath := currentDir + "/" + FilePath
|
|
|
|
|
//filePath := "/var/www/gold-shop/" + FilePath
|
|
|
|
|
|
|
|
|
|
fmt.Println("filepath: " + filePath)
|
|
|
|
|
|
|
|
|
|
content, err := os.ReadFile(filePath)
|
|
|
|
|
func InitConfig(configFilePath string) *config.Config {
|
|
|
|
|
fmt.Println("configFilePath: " + configFilePath)
|
|
|
|
|
content, err := os.ReadFile(configFilePath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Printf("err: %v\n", err)
|
|
|
|
|
panic(err)
|
|
|
|
|