Skip to content
This repository was archived by the owner on Jan 7, 2024. It is now read-only.

Commit 1f993ef

Browse files
author
Cody Zacharias
authored
Bug fix
1 parent 3dea6f6 commit 1f993ef

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

main.go

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626
)
2727

2828
type Http struct {
29-
Url, Num string
29+
Url string
3030
}
3131

3232
func getDomains(path string) (lines []string, Error error) {
@@ -153,30 +153,23 @@ func Identify(url string) (service string) {
153153
return service
154154
}
155155

156-
func Detect(url, num string) {
156+
func Detect(url string) {
157157
service := Identify(url)
158158

159-
// Clears previous line -- needs to be optimized in the future.
160-
fmt.Printf("\r%s", strings.Repeat(" ", 100))
161-
162159
if service != "" {
163160
result := fmt.Sprintf("[%s] %s\n", service, url)
164161

165-
fmt.Printf("\r%s", result)
162+
fmt.Printf(result)
166163

167164
if *Output != "" {
168165
write(result)
169166
}
170-
} else {
171-
fmt.Printf("\r")
172167
}
173-
174-
fmt.Printf("\r[ Domains \001b[31m%s\u001b[0m - Last Request to %s ]", num, url)
175168
}
176169

177170
func (s *Http) DNS() {
178171
if *Strict {
179-
Detect(s.Url, s.Num)
172+
Detect(s.Url)
180173
} else {
181174
cname, err := net.LookupCNAME(s.Url)
182175
if err != nil {
@@ -211,7 +204,7 @@ func (s *Http) DNS() {
211204

212205
for _, cn := range cnames {
213206
if strings.Contains(cname, cn) {
214-
Detect(s.Url, s.Num)
207+
Detect(s.Url)
215208
}
216209
}
217210
}
@@ -237,16 +230,12 @@ func Process() {
237230
}
238231

239232
for i := 0; i < len(list); i++ {
240-
Progress := fmt.Sprintf("%d", len(list))
241-
urls <- &Http{Url: list[i], Num: Progress}
233+
urls <- &Http{Url: list[i]}
242234
}
243235

244236
close(urls)
245237

246238
wg.Wait()
247-
248-
fmt.Printf("\r%s", strings.Repeat(" ", 100))
249-
fmt.Printf("\rTask completed.\n")
250239
}
251240

252241
func main() {

0 commit comments

Comments
 (0)