aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 22:15:03 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 22:15:03 +0200
commitf6c1eb7e58a5fc70e720311482f8147b791e6104 (patch)
tree4073bc0b2ae416252d02056839ca53b09941d39b
parent816f3da4d3c04cdf6c277e9083238b1377a46c74 (diff)
Minor edit
-rw-r--r--internal/qna/qna.go4
-rw-r--r--main.go2
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/qna/qna.go b/internal/qna/qna.go
index f8e6bd8..eab4b71 100644
--- a/internal/qna/qna.go
+++ b/internal/qna/qna.go
@@ -39,6 +39,10 @@ func (a Answer) String() string {
return fmt.Sprintf("%s header=%s attribute=%s", a.Domain, a.HTTP, a.HTML)
}
+func (a *Answer) OnionLocation() bool {
+ return a.HTTP != "" || a.HTML != ""
+}
+
type Progress struct {
NumOK int
NumOnion int
diff --git a/main.go b/main.go
index a372fa1..93f5348 100644
--- a/main.go
+++ b/main.go
@@ -144,7 +144,7 @@ func workReceiver(ctx context.Context, opts options.Options, answerCh chan qna.A
p := qna.Progress{}
handleAnswer := func(a qna.Answer) {
p.AddAnswer(a)
- if a.HTTP != "" || a.HTML != "" {
+ if a.OnionLocation() {
fmt.Printf("%s\n", a.String())
}
}