质量优化

This commit is contained in:
ryan
2026-06-10 13:42:15 +08:00
parent 3ed4dec4a3
commit 57944398e6
27 changed files with 155 additions and 111 deletions
+2 -2
View File
@@ -101,7 +101,7 @@ func getLocalCacheFile(ctx context.Context, localPath, metaPath string) (*Object
defer span.End()
// 尝试打开本地缓存文件
file, err := os.Open(localPath)
file, err := os.Open(localPath) //nolint:gosec // localPath is internally managed cache path
if err == nil {
defer func() { _ = file.Close() }()
}
@@ -118,7 +118,7 @@ func getLocalCacheFile(ctx context.Context, localPath, metaPath string) (*Object
}
// 读取元信息
metaData, err := os.ReadFile(metaPath)
metaData, err := os.ReadFile(metaPath) //nolint:gosec // metaPath is internally managed cache path
// 文件不存在
if err != nil && os.IsNotExist(err) {