🎉first commit

This commit is contained in:
2024-05-25 20:26:20 +04:00
commit 7a2558b25a
15 changed files with 1183 additions and 0 deletions

18
utils/slice.go Normal file
View File

@@ -0,0 +1,18 @@
package utils
func Flatten[T any](nested [][]T) []T {
flattened := make([]T, 0)
for _, n := range nested {
flattened = append(flattened, n...)
}
return flattened
}
func Contains[T comparable](slice []T, item T) bool {
for _, i := range slice {
if i == item {
return true
}
}
return false
}