-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfungen_auto.go
More file actions
24 lines (21 loc) · 835 Bytes
/
Copy pathfungen_auto.go
File metadata and controls
24 lines (21 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Package main - generated by fungen; DO NOT EDIT
package main
// GeneratorList is the type for a list that holds members of type Generator
type GeneratorList []Generator
// Filter is a method on GeneratorList that takes a function of type Generator -> bool returns a list of type GeneratorList which contains all members from the original list for which the function returned true
func (l GeneratorList) Filter(f func(Generator) bool) GeneratorList {
l2 := []Generator{}
for _, t := range l {
if f(t) {
l2 = append(l2, t)
}
}
return l2
}
// Each is a method on GeneratorList that takes a function of type Generator -> void and applies the function to each member of the list and then returns the original list.
func (l GeneratorList) Each(f func(Generator)) GeneratorList {
for _, t := range l {
f(t)
}
return l
}