diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-04-02 21:21:04 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-04-02 22:06:32 +0200 |
commit | 816f3da4d3c04cdf6c277e9083238b1377a46c74 (patch) | |
tree | 7e8cf77ac385e957a8a49783631604e83d9de44d /main.go | |
parent | ad0981749ab82e1401e30a20e8973ce32d30dcf0 (diff) |
Annotate (non-)deadline more clearly
Made sense to then split conn errors as well.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -109,6 +109,10 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question req, err := http.NewRequestWithContext(cctx, http.MethodGet, "https://"+question.Domain, nil) if err != nil { answer.ReqErr = err + if cctx.Err() != nil { + answer.CtxErr = true + } + answerCh <- answer return } @@ -116,6 +120,10 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question rsp, err := cli.Do(req) if err != nil { answer.DoErr = err + if cctx.Err() != nil { + answer.CtxErr = true + } + answerCh <- answer return } |