mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
23 lines
348 B
Go
23 lines
348 B
Go
|
package slice
|
||
|
|
||
|
func ContainsString(slice []string, item string) bool {
|
||
|
for _, j := range slice {
|
||
|
if j == item {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
func StringsEqual(left, right []string) bool {
|
||
|
if len(left) != len(right) {
|
||
|
return false
|
||
|
}
|
||
|
for i := 0; i < len(left); i++ {
|
||
|
if left[i] != right[i] {
|
||
|
return false
|
||
|
}
|
||
|
}
|
||
|
return true
|
||
|
}
|