gowiki/pkg/core/helper.go
2021-02-18 22:36:16 +01:00

13 lines
245 B
Go

// Copyright (C) 2020 Marius Schellenberger
package core
// Contains checks if slice a contains string str
func Contains(str string, a []string) (int, bool) {
for i, s := range a {
if s == str {
return i, true
}
}
return -1, false
}