使用此代码,Jenkins管道中出现错误。我不明白为什么?我想念什么吗?
<ul> <li> word1</li> </ul>"
错误:
fun List<String?>.processList(action: (String) -> String): List<String> {
var remove = false
val dest = arrayListOf<String>()
return filterNotNullTo(dest).mapIndexedNotNull { index, s ->
if (remove) {
remove = false
null
} else {
if (index + 1 <= dest.lastIndex && s == dest[index + 1]) {
remove = true
action()
} else {
s
}
}
}
}
val l = listOf("Q", null, "W", "E", null, "E", "E", "R", "R", "T")
val result = l.processList {"${it}gotcha"}