mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-15 11:13:09 -06:00
13 lines
295 B
Go
13 lines
295 B
Go
|
package terraform
|
||
|
|
||
|
// strSliceContains checks if a given string is contained in a slice
|
||
|
// When anybody asks why Go needs generics, here you go.
|
||
|
func strSliceContains(haystack []string, needle string) bool {
|
||
|
for _, s := range haystack {
|
||
|
if s == needle {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|