add fs lib to walk file tree

This commit is contained in:
2025-12-31 01:32:20 +00:00
parent c3200f9115
commit f1a6f4afb5
3 changed files with 223 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
package main
// 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
}