2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 03:07:20 +08:00

fix: lint

This commit is contained in:
2026-01-14 23:22:24 +08:00
parent bf3ce388d1
commit fad7da38b6

View File

@@ -8,6 +8,7 @@ import (
"encoding/hex"
"fmt"
stdio "io"
"mime/multipart"
"net/http"
stdos "os"
"path/filepath"
@@ -635,7 +636,7 @@ func (s *FileService) ChunkUploadChunk(w http.ResponseWriter, r *http.Request) {
Error(w, http.StatusInternalServerError, s.t.Get("open upload file error: %v", err))
return
}
defer src.Close()
defer func(src multipart.File) { _ = src.Close() }(src)
// 读取分块内容
chunkData, err := stdio.ReadAll(src)
@@ -690,7 +691,7 @@ func (s *FileService) ChunkUploadFinish(w http.ResponseWriter, r *http.Request)
Error(w, http.StatusInternalServerError, s.t.Get("create target file error: %v", err))
return
}
defer outFile.Close()
defer func(outFile *stdos.File) { _ = outFile.Close() }(outFile)
// 按顺序合并分块
prefix := s.getChunkTempFilePrefix(req.FileName, req.FileHash)