push all exercices
This commit is contained in:
BIN
ch5/3/ch5_3.exe
Normal file
BIN
ch5/3/ch5_3.exe
Normal file
Binary file not shown.
13
ch5/3/ch5_3.go
Normal file
13
ch5/3/ch5_3.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func prefixer(prefix string) func(string) string {
|
||||
return func(s string) string { return prefix + " " + s }
|
||||
}
|
||||
|
||||
func main() {
|
||||
helloPrefix := prefixer("Hello")
|
||||
fmt.Println(helloPrefix("Bob")) // should print Hello Bob
|
||||
fmt.Println(helloPrefix("Maria")) // should print Hello Maria
|
||||
}
|
||||
3
ch5/3/go.mod
Normal file
3
ch5/3/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module ch5_3
|
||||
|
||||
go 1.25.0
|
||||
Reference in New Issue
Block a user