diff options
-rw-r--r-- | internal/qna/qna.go | 4 | ||||
-rw-r--r-- | main.go | 2 |
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 @@ -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()) } } |