refactor fstree to separate package

This commit is contained in:
2025-12-31 03:12:06 +00:00
parent 130e973be8
commit 74113ccdc0
6 changed files with 12 additions and 9 deletions
+11
View File
@@ -0,0 +1,11 @@
package utils
// Removes the first occurence from the slice. Worst case O(n)
func RemoveFromSlice[T comparable](slice []T, item T) []T {
for i, v := range slice {
if v == item {
return append(slice[:i], slice[i+1:]...)
}
}
return slice
}