mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 18:20:27 +00:00
✏️ make lint happy
This commit is contained in:
@@ -5,6 +5,7 @@ package file
|
||||
|
||||
import "os"
|
||||
|
||||
// Pwd 获取当前路径
|
||||
func Pwd() (path string) {
|
||||
path, _ = os.Getwd()
|
||||
return
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Pwd 获取当前路径的正斜杠表示
|
||||
func Pwd() string {
|
||||
path, _ := os.Getwd()
|
||||
return strings.ReplaceAll(path, "\\", "/")
|
||||
|
||||
@@ -2,6 +2,7 @@ package file
|
||||
|
||||
import "os"
|
||||
|
||||
// BOT_PATH BOT当前路径
|
||||
var BOT_PATH = Pwd()
|
||||
|
||||
// IsExist 文件/路径存在
|
||||
@@ -10,7 +11,7 @@ func IsExist(path string) bool {
|
||||
return err == nil || os.IsExist(err)
|
||||
}
|
||||
|
||||
// IsExist 文件/路径不存在
|
||||
// IsNotExist 文件/路径不存在
|
||||
func IsNotExist(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
return err != nil && os.IsNotExist(err)
|
||||
|
||||
@@ -82,7 +82,7 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(data) <= 0 {
|
||||
if len(data) == 0 {
|
||||
return nil, errors.New("read body len <= 0")
|
||||
}
|
||||
if filemd5 != nil {
|
||||
|
||||
Reference in New Issue
Block a user