17 lines
352 B
Go
17 lines
352 B
Go
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package utils
|
||
|
|
||
|
// Contains checks containment
|
||
|
func Contains(haystack []string, needle string) bool {
|
||
|
for _, s := range haystack {
|
||
|
if s == needle {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return false
|
||
|
}
|