tweaks
This commit is contained in:
parent
d19153e5f6
commit
92bcbe8acc
@ -19,14 +19,14 @@ func main() {
|
|||||||
|
|
||||||
// To invoke this function in a goroutine, use
|
// To invoke this function in a goroutine, use
|
||||||
// `go f(s)`. This new goroutine will execute
|
// `go f(s)`. This new goroutine will execute
|
||||||
// concurrently with the current one.
|
// concurrently with the calling one.
|
||||||
go f("goroutine")
|
go f("goroutine")
|
||||||
|
|
||||||
// You can also start a goroutine for an anonymous
|
// You can also start a goroutine for an anonymous
|
||||||
// function.
|
// function call.
|
||||||
go func() {
|
go func(msg string) {
|
||||||
fmt.Println("going")
|
fmt.Println(msg)
|
||||||
}()
|
}("going")
|
||||||
|
|
||||||
// Our two goroutines are running asynchronously in
|
// Our two goroutines are running asynchronously in
|
||||||
// separate goroutines now, so execution falls through
|
// separate goroutines now, so execution falls through
|
||||||
|
Loading…
x
Reference in New Issue
Block a user