fix: 修复配置文件路径问题

This commit is contained in:
Mmx
2021-09-20 09:20:03 +08:00
parent 12e9b00324
commit bb45aa9971
5 changed files with 6 additions and 23 deletions

View File

@@ -3,6 +3,7 @@ package global
import (
"autoLogin/models"
"github.com/Mmx233/config"
"github.com/Mmx233/tool"
"log"
"os"
)
@@ -10,6 +11,8 @@ import (
var Config models.Config
func init() {
tool.File.Options.ForceRoot = true
//配置文件初始化
if e := config.Load(config.Options{
Config: &Config,

2
go.mod
View File

@@ -4,7 +4,7 @@ go 1.16
require (
github.com/Mmx233/config v0.0.3
github.com/Mmx233/tool v0.2.4
github.com/Mmx233/tool v0.2.5
github.com/PuerkitoBio/goquery v1.7.1 // indirect
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf // indirect
)

4
go.sum
View File

@@ -1,7 +1,7 @@
github.com/Mmx233/config v0.0.3 h1:E744hob5fWD5P7m7q+91Z41R+Y1LDkxIhQXIeV1tel0=
github.com/Mmx233/config v0.0.3/go.mod h1:3mt+LSHUvD/C6tq1ge/Dmp8xKivFmo7gxSihCPjIAi0=
github.com/Mmx233/tool v0.2.4 h1:lsq45GmGJGZ7RkOVj6EYucvxRK58/nGSVf8rhgZNov0=
github.com/Mmx233/tool v0.2.4/go.mod h1:un5MCoI21lH40fFI5S9++aja8nJb+2sjATak7PnGMZ0=
github.com/Mmx233/tool v0.2.5 h1:48iYgydVhoqDqeVXKBXS6WALRbp/0W3WRalo4/yV/xY=
github.com/Mmx233/tool v0.2.5/go.mod h1:un5MCoI21lH40fFI5S9++aja8nJb+2sjATak7PnGMZ0=
github.com/PuerkitoBio/goquery v1.7.1 h1:oE+T06D+1T7LNrn91B4aERsRIeCLJ/oPSa6xB9FPnz4=
github.com/PuerkitoBio/goquery v1.7.1/go.mod h1:XY0pP4kfraEmmV1O7Uf6XyjoslwsneBbgeDjLYuN8xY=
github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=

View File

@@ -1,19 +0,0 @@
package util
import "reflect"
type reflectR struct{}
var Reflect reflectR
func (*reflectR) IsEmpty(v reflect.Value) bool {
switch v.Kind() {
case reflect.Bool:
return !v.Bool()
case reflect.String:
return v.String() == ""
default:
panic("未设定值")
}
return false
}

View File

@@ -9,5 +9,4 @@ import (
func init() {
//tool设定
tool.HTTP.Options.Timeout = time.Duration(global.Config.Settings.Timeout) * time.Second
tool.File.Options.ForceRoot = true
}