first commit

This commit is contained in:
2026-05-15 23:36:12 +08:00
parent 62fe8ddf4a
commit 52d6dde4aa
10 changed files with 286 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package gitignore
import (
"os"
"path/filepath"
ignore "github.com/sabhiram/go-gitignore"
)
func Load(root string) (*ignore.GitIgnore, error) {
path := filepath.Join(root, ".gitignore")
if _, err := os.Stat(path); os.IsNotExist(err) {
return ignore.CompileIgnoreLines(), nil
}
return ignore.CompileIgnoreFile(path)
}