init project

This commit is contained in:
admin committed 2025-12-05 17:23:29 +08:00
commit d63cc8d9f5
33 files changed
+1529

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package util
import "strings"
func UniqueArr[T comparable](inList []T) (outList []T) {
data := make(map[T]bool)
for _, id := range inList {
if !data[id] {
data[id] = true
outList = append(outList, id)
}
}
return outList
}
func FilterEmptyArray(list []string) (result []string) {
for _, str := range list {
str = strings.TrimSpace(str)
if str != "" {
result = append(result, str)
}
}
return
}