清理代码 & 支持 ignore

This commit is contained in:
dragon
2025-05-09 14:50:10 +08:00
parent 9413188aa9
commit ef31433d91
14 changed files with 405 additions and 118 deletions

15
pkg/utils/array.go Normal file
View File

@@ -0,0 +1,15 @@
package utils
func ClearDuplicates[T comparable](slice []T) []T {
seen := make(map[T]bool)
for _, val := range slice {
seen[val] = true
}
var result []T
for key := range seen {
result = append(result, key)
}
return result
}