Skip to content

Commit

Permalink
UPSTREAM: <drop>: use go.1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
soltysh committed Dec 8, 2023
1 parent 99a6f47 commit 7ef7913
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/e2e/framework/ginkgowrapper.go
Expand Up @@ -300,7 +300,7 @@ func validateText(location types.CodeLocation, text string, labels []string) {
}
// Strip square brackets.
tag = tag[1 : len(tag)-1]
if slices.Contains(labels, tag) {
if slicesContains(labels, tag) {
// Okay, was also set as label.
continue
}
Expand Down Expand Up @@ -566,3 +566,16 @@ func slicesEqual[S ~[]E, E comparable](s1, s2 S) bool {
}
return true
}

func slicesContains[S ~[]E, E comparable](s S, v E) bool {
return slicesIndex(s, v) >= 0
}

func slicesIndex[S ~[]E, E comparable](s S, v E) int {
for i := range s {
if v == s[i] {
return i
}
}
return -1
}

0 comments on commit 7ef7913

Please sign in to comment.