mirror of
https://github.com/bloeys/cogo.git
synced 2025-12-29 08:58:19 +00:00
39 lines
487 B
Go
Executable File
39 lines
487 B
Go
Executable File
// Code generated by 'cogo'; DO NOT EDIT.
|
|
package main
|
|
|
|
import "github.com/bloeys/cogo/cogo"
|
|
|
|
func test_cogo(c *cogo.Coroutine[int, int]) (out int) {
|
|
switch c.State {
|
|
case 0:
|
|
|
|
println("Tick 1")
|
|
c.State++
|
|
return 1
|
|
case 1:
|
|
|
|
println("Tick 2")
|
|
c.State++
|
|
return 2
|
|
case 2:
|
|
|
|
println("Tick 3")
|
|
c.State++
|
|
return 3
|
|
case 3:
|
|
|
|
println("Tick 4")
|
|
c.State++
|
|
return 4
|
|
case 4:
|
|
c.State = -1
|
|
|
|
println("Tick before end")
|
|
|
|
return out
|
|
default:
|
|
c.State = -1
|
|
return
|
|
}
|
|
}
|