FAQ
This is fine, even if you call the function in the loop in a goroutine. The
local variable in spawnOverlord doesn't change for the closure.
Calling spawnOverlord in a loop results in multiple invocations of it.

You *should* be worried about the top item on this list, in general,
although it does not occur in your code sample:
https://github.com/golang/go/wiki/CommonMistakes

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 2, '16 at 7:01p
activeMay 2, '16 at 7:07p
posts2
users2
websitegolang.org

2 users in discussion

Shawn Milochik: 1 post Dump Hole: 1 post

People

Translate

site design / logo © 2021 Grokbase