Skip to content

Commit c76d991

Browse files
authored
examples/server/distributed: address comment in #380
I failed to push my branch before merging #380. Address one minor comment from that PR.
1 parent 0bb1a42 commit c76d991

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/server/distributed/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func parent() {
8080
var wg sync.WaitGroup
8181
childURLs := make([]*url.URL, len(ports))
8282
for i, port := range ports {
83-
wg.Add(1)
8483
childURL := fmt.Sprintf("http://localhost:%s", port)
8584
childURLs[i], err = url.Parse(childURL)
8685
if err != nil {
@@ -89,6 +88,8 @@ func parent() {
8988
cmd := exec.CommandContext(ctx, exe, os.Args[1:]...)
9089
cmd.Env = append(os.Environ(), fmt.Sprintf("%s=%s", childPortVar, port))
9190
cmd.Stderr = os.Stderr
91+
92+
wg.Add(1)
9293
go func() {
9394
defer wg.Done()
9495
log.Printf("starting child %d at %s", i, childURL)

0 commit comments

Comments
 (0)