-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
34 lines (26 loc) · 800 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
godeferred: Deferred for golang (ports of jsdeferred)
USAGE:
package main
import . "deferred"
import "os"
func main() {
Deferred().
Next(func() string {
// pass to next v
return "Hello World"
}).
Next(func(v string) (string, os.Error) {
// will be shown: Good Morning, Hello World
println("Good Morning, " + v)
// make error, goto Error()
return "", os.NewError("Now time is not morning")
}).
Error(func(err *os.Error) {
// will be shown: Ooooops!: Now time is not morning
println("Ooooops!: " + (*err).String())
})
}
AUTHOR:
Yasuhiro Matsumoto <[email protected]>
THANKS:
cho45: Author of jsdeferred