fix: all issues by golangci-lint

This commit is contained in:
verse91
2026-05-09 23:49:33 +07:00
parent e587f02798
commit c76541258a
18 changed files with 118 additions and 79 deletions
+7 -7
View File
@@ -12,15 +12,15 @@ import (
func TestFileGenerator(t *testing.T) {
// Setup mock files
tmp := t.TempDir()
os.MkdirAll(filepath.Join(tmp, "src"), 0755)
os.WriteFile(filepath.Join(tmp, "main.go"), []byte(""), 0644)
os.WriteFile(filepath.Join(tmp, "README.md"), []byte(""), 0644)
os.WriteFile(filepath.Join(tmp, ".hidden"), []byte(""), 0644)
os.WriteFile(filepath.Join(tmp, "src/utils.go"), []byte(""), 0644)
_ = os.MkdirAll(filepath.Join(tmp, "src"), 0755)
_ = os.WriteFile(filepath.Join(tmp, "main.go"), []byte(""), 0644)
_ = os.WriteFile(filepath.Join(tmp, "README.md"), []byte(""), 0644)
_ = os.WriteFile(filepath.Join(tmp, ".hidden"), []byte(""), 0644)
_ = os.WriteFile(filepath.Join(tmp, "src/utils.go"), []byte(""), 0644)
oldWd, _ := os.Getwd()
os.Chdir(tmp)
defer os.Chdir(oldWd)
_ = os.Chdir(tmp)
defer func() { _ = os.Chdir(oldWd) }()
// REQUIREMENT: dirOnly shows only dirs
t.Run("dirOnly shows only dirs", func(t *testing.T) {