单元测试查询

This commit is contained in:
2023-11-30 04:03:19 +08:00
parent e3174a125c
commit ffa12e09cb
3 changed files with 31 additions and 29 deletions

View File

@@ -1,7 +1,6 @@
package models
import (
"fmt"
"log"
"path/filepath"
"runtime"
@@ -16,10 +15,7 @@ var (
)
func init() {
//如果命令行参数中有test则使用测试环境的配置
config_file := filepath.Join(Root, "data", "config.yaml")
fmt.Println(config_file)
viper.SetConfigFile(config_file)
if err := viper.ReadInConfig(); err != nil {
log.Println("读取配置文件失败", err)