mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
8 lines
200 B
Go
8 lines
200 B
Go
package underscore
|
|
|
|
// Each iterates over a slice of elements, yielding each in turn to an action function.
|
|
func Each[T any](values []T, action func(T)) {
|
|
for _, v := range values {
|
|
action(v)
|
|
}
|
|
}
|