Answers for "goroutine"

0

goroutine

// just a function (which can be later started as a goroutine)
func doStuff(s string) {
}

func main() {
    // using a named function in a goroutine
    go doStuff("foobar")

    // using an anonymous inner function in a goroutine
    go func (x int) {
        // function body goes here
    }(42)
}
Posted by: Guest on January-12-2021
0

goroutine

package main
Posted by: Guest on October-21-2020
0

run thread golang

func f(s string){
	fmt.Println(s)
}

func main(){
	go f("goroutine")
}
Posted by: Guest on December-09-2020

Code answers related to "goroutine"

Browse Popular Code Answers by Language