(Feat): Initial Commit
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled

This commit is contained in:
2026-07-03 19:41:31 +05:30
commit 7e940c83a7
461 changed files with 45002 additions and 0 deletions

39
internal/util/slice.go Normal file
View File

@@ -0,0 +1,39 @@
// nolint:revive
package util
// ContainsAllString checks whether the given string slice contains all strings provided.
func ContainsAllString(slice []string, sub ...string) bool {
contains := make(map[string]bool)
for _, v := range sub {
contains[v] = false
}
for _, v := range slice {
if _, ok := contains[v]; ok {
contains[v] = true
}
}
for _, v := range contains {
if !v {
return false
}
}
return true
}
// UniqueString takes the string slice provided and returns a new slice with all duplicates removed.
func UniqueString(slice []string) []string {
seen := make(map[string]struct{})
res := make([]string, 0)
for _, s := range slice {
if _, ok := seen[s]; !ok {
res = append(res, s)
seen[s] = struct{}{}
}
}
return res
}