Mastering-Go-Second-Edition/ch10/endlessComp.go
2019-04-02 19:49:47 +03:00

19 lines
218 B
Go

package main
import (
"fmt"
"runtime"
)
func main() {
var i byte
go func() {
for i = 0; i <= 255; i++ {
}
}()
fmt.Println("Leaving goroutine!")
runtime.Gosched()
runtime.GC()
fmt.Println("Good bye!")
}