This avoids issues with the various deferred error handlers in the event that `err` is shadowed or named differently, which this function currently avoids but which is an easy trap to fall into. Since named return values are all or nothing we need to name the waitGroup too and adjust the code to suite. Thanks to Aaron Lehmann for the suggestion, see also https://github.com/docker/swarmkit/pull/1965#discussion_r118137410 Signed-off-by: Ian Campbell <ian.campbell@docker.com>