Update index when updating resources.

This commit is contained in:
2025-09-08 21:24:08 +08:00
parent 5bf2544282
commit d64b1e78ef
3 changed files with 41 additions and 36 deletions

13
server/utils/slice.go Normal file
View File

@@ -0,0 +1,13 @@
package utils
func RemoveDuplicate[T comparable](slice []T) []T {
seen := make(map[T]struct{})
var result []T
for _, v := range slice {
if _, ok := seen[v]; !ok {
seen[v] = struct{}{}
result = append(result, v)
}
}
return result
}