internal/codespaces/portforwarder: define err in go func instead of use err defined in outer scope

Fixes #13001
This commit is contained in:
Qingwei Li 2026-03-26 00:31:56 +08:00 committed by GitHub
parent 1df6f84d70
commit e53e360d5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -276,7 +276,7 @@ func (fwd *CodespacesPortForwarder) UpdatePortVisibility(ctx context.Context, re
done := make(chan error)
go func() {
// Connect to the tunnel
err = fwd.connection.Connect(ctx)
err := fwd.connection.Connect(ctx)
if err != nil {
done <- fmt.Errorf("connect failed: %v", err)
return