aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-03-25 18:07:08 +0100
committerRasmus Dahlberg <rasmus@rgdd.se>2023-03-25 18:07:08 +0100
commit46aae951cd61d459c7e67fd835fdcd4a707eeefc (patch)
treea3e208f428ed14314a57bc8f2d268b111108bbbd
parent046b19055ea1e230b5e949c241ddcb3f76a45699 (diff)
Send answer w/o connect for bad URL too
-rw-r--r--main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.go b/main.go
index 6fcdd00..52ea628 100644
--- a/main.go
+++ b/main.go
@@ -146,12 +146,13 @@ func work(ctx context.Context, opts *options.Options, cli *http.Client, question
cctx, cancel := context.WithTimeout(ctx, opts.Timeout)
defer cancel()
+ answer := qna.Answer{Domain: question.Domain}
req, err := http.NewRequestWithContext(cctx, http.MethodGet, "https://"+question.Domain, nil)
if err != nil {
+ answerCh <- answer
return
}
- answer := qna.Answer{Domain: question.Domain}
rsp, err := cli.Do(req)
if err != nil {
answerCh <- answer