单元测试查询
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user