fscan/Common/Utils.go
2025-05-25 13:28:12 +08:00

16 lines
272 B
Go

package Common
func RemoveDuplicate(old []string) []string {
temp := make(map[string]struct{})
var result []string
for _, item := range old {
if _, exists := temp[item]; !exists {
temp[item] = struct{}{}
result = append(result, item)
}
}
return result
}