fix go vet loopclosure finding

This commit is contained in:
Alan Donovan 2021-09-02 16:02:09 -04:00
parent 4e2c20606a
commit 1162c8adff

View file

@ -276,6 +276,7 @@ func forwardPorts(log *output.Logger, codespaceName string, ports []string) erro
ctx, cancel := context.WithCancel(ctx)
defer cancel()
for _, pair := range portPairs {
pair := pair
log.Printf("Forwarding ports: remote %d <=> local %d\n", pair.remote, pair.local)
name := fmt.Sprintf("share-%d", pair.remote)
go func() {