lbry.go/util/slice.go
Niko Storni 788857d2c3
add disk space check
remove unneeded panics
improve error handling
add tests
fix error checking that was comparing for exact values
sort imports
2018-07-12 08:24:43 -04:00

21 lines
319 B
Go

package util
import "strings"
func InSlice(str string, values []string) bool {
for _, v := range values {
if str == v {
return true
}
}
return false
}
func InSliceContains(str string, values []string) bool {
for _, v := range values {
if strings.Contains(v, str) {
return true
}
}
return false
}