mirror of
https://github.com/bloeys/cogo.git
synced 2025-12-29 08:58:19 +00:00
Stuff
This commit is contained in:
45
main.go
45
main.go
@ -24,32 +24,53 @@ func Wow() {
|
||||
println("wow")
|
||||
}
|
||||
|
||||
func test() {
|
||||
// func test() {
|
||||
|
||||
// cogo.Begin()
|
||||
|
||||
// println("hi")
|
||||
// println("this is from state_0")
|
||||
// cogo.Yield()
|
||||
// state = 1
|
||||
|
||||
// if 1 > 2 {
|
||||
// println("gg")
|
||||
// }
|
||||
|
||||
// println("Bye")
|
||||
// println("this is from state_1")
|
||||
// cogo.Yield()
|
||||
// state = 2
|
||||
|
||||
// cogo.End()
|
||||
// }
|
||||
|
||||
func test2() {
|
||||
|
||||
cogo.Begin()
|
||||
|
||||
println("hi")
|
||||
println("this is from state_0")
|
||||
println("Hey")
|
||||
cogo.Yield()
|
||||
state = 1
|
||||
|
||||
if 1 > 2 {
|
||||
println("gg")
|
||||
}
|
||||
println("How you?")
|
||||
cogo.Yield()
|
||||
|
||||
println("Bye")
|
||||
println("this is from state_1")
|
||||
cogo.Yield()
|
||||
state = 2
|
||||
|
||||
cogo.End()
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
test()
|
||||
test()
|
||||
test()
|
||||
// test()
|
||||
// test()
|
||||
// test()
|
||||
|
||||
test2()
|
||||
test2()
|
||||
test2()
|
||||
test2()
|
||||
|
||||
println("Final state:", state)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user