diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29b636a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +*.iml \ No newline at end of file diff --git a/2022/01/go_func1/Program.go b/2022/01/go_func1/Program.go new file mode 100644 index 0000000..0decab3 --- /dev/null +++ b/2022/01/go_func1/Program.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "github.com/mariomac/gostream/stream" +) + +func isEven(n int) bool { + return n%2 == 0 +} + +func main() { + fmt.Println("Hello World") + stream.Of(0, 1, 2, 3, 4). + Filter(func(n int) { + return n%2 == 0 + }). + ForEach(func(n int) { + fmt.Printf("Number %v\n", n) + }) +}