mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
12 lines
239 B
Go
12 lines
239 B
Go
package vals
|
|
|
|
// Feed calls the function with given values, breaking earlier if the function
|
|
// returns false.
|
|
func Feed(f func(interface{}) bool, values ...interface{}) {
|
|
for _, value := range values {
|
|
if !f(value) {
|
|
break
|
|
}
|
|
}
|
|
}
|