✏️ make lint happy

This commit is contained in:
fumiama
2021-12-19 11:39:30 +08:00
parent a9f98763c4
commit 4ad7ff7971
7 changed files with 11 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ package file
import "os"
// Pwd 获取当前路径
func Pwd() (path string) {
path, _ = os.Getwd()
return

View File

@@ -8,6 +8,7 @@ import (
"strings"
)
// Pwd 获取当前路径的正斜杠表示
func Pwd() string {
path, _ := os.Getwd()
return strings.ReplaceAll(path, "\\", "/")

View File

@@ -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)

View File

@@ -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 {