summaryrefslogtreecommitdiff
path: root/android/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/util.go')
-rw-r--r--android/util.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/android/util.go b/android/util.go
index e74b64e61..8dbf21459 100644
--- a/android/util.go
+++ b/android/util.go
@@ -141,6 +141,16 @@ func PrefixInList(list []string, prefix string) bool {
return false
}
+// Returns true if any string in the given list has the given suffix.
+func SuffixInList(list []string, suffix string) bool {
+ for _, s := range list {
+ if strings.HasSuffix(s, suffix) {
+ return true
+ }
+ }
+ return false
+}
+
// IndexListPred returns the index of the element which in the given `list` satisfying the predicate, or -1 if there is no such element.
func IndexListPred(pred func(s string) bool, list []string) int {
for i, l := range list {