mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 11:33:48 +08:00
goimport
This commit is contained in:
parent
7818603f39
commit
373127b799
@ -12,14 +12,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hjson/hjson-go"
|
"github.com/hjson/hjson-go"
|
||||||
"github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
var json = jsoniter.ConfigCompatibleWithStandardLibrary
|
var json = jsoniter.ConfigCompatibleWithStandardLibrary
|
||||||
|
|
||||||
var currentPath=getCurrentPath()
|
var currentPath = getCurrentPath()
|
||||||
var DefaultConfFile =path.Join(currentPath,"config.hjson")
|
var DefaultConfFile = path.Join(currentPath, "config.hjson")
|
||||||
|
|
||||||
// DefaultConfigWithComments 为go-cqhttp的默认配置文件
|
// DefaultConfigWithComments 为go-cqhttp的默认配置文件
|
||||||
var DefaultConfigWithComments = `
|
var DefaultConfigWithComments = `
|
||||||
@ -321,6 +321,7 @@ func (c *JSONConfig) Save(path string) error {
|
|||||||
}
|
}
|
||||||
return WriteAllText(path, string(data))
|
return WriteAllText(path, string(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
// getCurrentPath 获取当前文件的路径,直接返回string
|
// getCurrentPath 获取当前文件的路径,直接返回string
|
||||||
func getCurrentPath() string {
|
func getCurrentPath() string {
|
||||||
cwd, e := GetCurrentPath()
|
cwd, e := GetCurrentPath()
|
||||||
@ -347,8 +348,8 @@ func GetCurrentPath() (string, error) {
|
|||||||
//fmt.Println("path222:", path)
|
//fmt.Println("path222:", path)
|
||||||
i := strings.LastIndex(fpath, "/")
|
i := strings.LastIndex(fpath, "/")
|
||||||
if i < 0 {
|
if i < 0 {
|
||||||
return "", errors.New("system/path_error,Can't find '/' or '\\'");
|
return "", errors.New("system/path_error,Can't find '/' or '\\'")
|
||||||
}
|
}
|
||||||
//fmt.Println("path333:", path)
|
//fmt.Println("path333:", path)
|
||||||
return string(fpath[0 : i+1]), nil
|
return string(fpath[0 : i+1]), nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user