net: return proper error from Context

Sadly err was a named parameter so this did not cause
compile error.

Fixes #71974

Change-Id: I10cf29ae14c52d48a793c9a6cb01b01d79b1b356
GitHub-Last-Rev: 4dc0e6670a9265612b8ec26dbc378219b25156b4
GitHub-Pull-Request: golang/go#71976
Reviewed-on: https://go-review.googlesource.com/c/go/+/652815
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Mateusz Poliwczak 2025-02-26 16:31:58 +00:00 committed by Gopher Robot
parent 9cceaf8736
commit c55c1cbd04

View File

@ -65,7 +65,7 @@ func query(ctx context.Context, filename, query string, bufSize int) (addrs []st
case r := <-ch:
return r.addrs, r.err
case <-ctx.Done():
return nil, mapErr(err)
return nil, mapErr(ctx.Err())
}
}