add golangci-lint.

This commit is contained in:
孟帅
2023-05-31 18:01:50 +08:00
parent 46604b51b2
commit fdc48b9335
17 changed files with 425 additions and 479 deletions

View File

@@ -51,7 +51,6 @@ func WalkDir(dirname string) (error, []fileInfo) {
fileInfos = append(fileInfos, fi) //slice 中添加成员
}
}
return nil, fileInfos
}
@@ -64,7 +63,6 @@ func DirSize(dirname string) string {
for _, n := range files {
ss += n.size
}
return format.FileSize(ss)
}

View File

@@ -133,15 +133,10 @@ func Ext(baseName string) string {
}
// UploadFileByte 获取上传文件的byte
func UploadFileByte(file *ghttp.UploadFile) (b []byte, err error) {
func UploadFileByte(file *ghttp.UploadFile) ([]byte, error) {
open, err := file.Open()
if err != nil {
return
return nil, err
}
all, err := io.ReadAll(open)
if err != nil {
return
}
return all, nil
return io.ReadAll(open)
}