Beispiel #1
0
func helloWorld2() {
	gocchan.Invoke(nil, "hello", "Say2", func() {
		fmt.Println("Hello world!")
	})
}
Beispiel #2
0
func main() {
	gocchan.AddFeature("notify", &NotifyFeature{})
	gocchan.AddEventListener(&NotifyListen{})
	gocchan.Invoke("", "notify", "Panic", nil)
	gocchan.WaitNotify()
}
Beispiel #3
0
func helloWorld1(ctx bool) {
	gocchan.Invoke(ctx, "hello", "Say1", func() {
		fmt.Println("Hello world!")
	})
}
Beispiel #4
0
func main() {
	gocchan.AddFeature("types", &TypesFeature{})
	gocchan.Invoke("string", "types", "CallByString", nil)              // print "string"
	gocchan.Invoke(1, "types", "CallByInt", nil)                        // print "1"
	gocchan.Invoke(&TestStruct{"struct"}, "types", "CallByStruct", nil) // print "&{struct}"
}