1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

more test refactoring

This commit is contained in:
Jesse Duffield
2021-12-31 10:24:53 +11:00
parent 9c4a819683
commit ad9b2df104
4 changed files with 74 additions and 117 deletions

View File

@ -2,8 +2,12 @@ package utils
// IncludesString if the list contains the string
func IncludesString(list []string, a string) bool {
return IncludesStringFunc(list, func(b string) bool { return b == a })
}
func IncludesStringFunc(list []string, fn func(string) bool) bool {
for _, b := range list {
if b == a {
if fn(b) {
return true
}
}