Article Outline
Go programming example 'golang-functionanonymous'
golang-functionanonymous
Golang beginners example: golang-functionanonymous
package main
import (
"fmt"
)
func main() {
stop := make(chan bool)
go func() {
fmt.Println("this is Println inside an anonymous goroutine")
stop <- true
}()
func() {
fmt.Println("this is Println inside an anonymous function")
}()
<-stop
}
Useful links
- Learn Go: https://golangr.com
- Download Go: https://golang.org