clean dead codes

This commit is contained in:
2026-05-16 03:57:48 +08:00
parent 5e5727f021
commit 242e3fde38
4 changed files with 0 additions and 93 deletions
-27
View File
@@ -1,27 +0,0 @@
package utils
import (
"os"
"path/filepath"
)
func ExpandPaths(patterns []string) ([]string, error) {
var result []string
for _, pattern := range patterns {
matches, err := filepath.Glob(pattern)
if err != nil {
return nil, err
}
for _, m := range matches {
info, err := os.Stat(m)
if err != nil || info.IsDir() {
continue
}
result = append(result, m)
}
}
return result, nil
}
-46
View File
@@ -1,46 +0,0 @@
package utils
import (
"os"
"path/filepath"
// "strings"
)
func ExpandGlob(patterns []string) ([]string, error) {
var result []string
for _, pattern := range patterns {
if pattern == "*" {
files, err := filepath.Glob("**") // fallback
if err != nil {
return nil, err
}
result = append(result, files...)
continue
}
matches, err := filepath.Glob(pattern)
if err != nil {
return nil, err
}
for _, m := range matches {
info, err := os.Stat(m)
if err != nil || info.IsDir() {
continue
}
result = append(result, m)
}
}
return result, nil
}
func add(path string, seen map[string]struct{}, result *[]string) {
if _, ok := seen[path]; ok {
return
}
seen[path] = struct{}{}
*result = append(*result, path)
}