]> Cypherpunks repositories - gostls13.git/commitdiff
net: return proper error from Context
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Wed, 26 Feb 2025 16:31:58 +0000 (16:31 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 26 Feb 2025 22:16:12 +0000 (14:16 -0800)
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>

src/net/lookup_plan9.go

index 0e179d31df26ebf8cd6c260b5c73a161ffd821ed..c9bab29aded7bad45106f78f375053831d8015a8 100644 (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())
        }
 }