chore: update golangci-lint config and fix lint issues (#542)

* chore: update golangci-lint config and fix lint issues
This commit is contained in:
Roger authored and GitHub committed 2026-04-04 16:26:07 +08:00
1 parent e35907de6f
commit 92053b85b0
14 files changed
+116 -138

No files matched your search

+3 -3
View File
@@ -29,7 +29,7 @@ func TestCompressDir(t *testing.T) {
defer os.RemoveAll(tempDir)
err := CompressDir(tempDir)
assert.NoError(t, err, "compressDir should not return an error")
require.NoError(t, err, "compressDir should not return an error")
// Check if the zip file exists
zipFile := filepath.Join(tempDir, filepath.Base(tempDir)+".zip")
@@ -38,7 +38,7 @@ func TestCompressDir(t *testing.T) {
t.Run("Directory Does Not Exist", func(t *testing.T) {
err := CompressDir("/path/to/nonexistent/directory")
assert.Error(t, err, "should return an error for non-existent directory")
require.Error(t, err, "should return an error for non-existent directory")
})
t.Run("Empty Directory", func(t *testing.T) {
@@ -47,6 +47,6 @@ func TestCompressDir(t *testing.T) {
defer os.RemoveAll(tempDir)
err = CompressDir(tempDir)
assert.Error(t, err, "should return an error for an empty directory")
require.Error(t, err, "should return an error for an empty directory")
})
}