Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestVerboseLog(t *testing.T) {
os.Stdout = old

var buf bytes.Buffer
io.Copy(&buf, r)
_, _ = io.Copy(&buf, r)
output := buf.String()

if !strings.Contains(output, "[VERBOSE]") {
Expand All @@ -43,7 +43,7 @@ func TestVerboseLog(t *testing.T) {
os.Stdout = old

buf.Reset()
io.Copy(&buf, r)
_, _ = io.Copy(&buf, r)
output = buf.String()

if output != "" {
Expand All @@ -63,7 +63,7 @@ func TestErrorLog(t *testing.T) {
os.Stdout = old

var buf bytes.Buffer
io.Copy(&buf, r)
_, _ = io.Copy(&buf, r)
output := buf.String()

if !strings.Contains(output, "[ERROR]") {
Expand All @@ -86,7 +86,7 @@ func TestInfoLog(t *testing.T) {
os.Stdout = old

var buf bytes.Buffer
io.Copy(&buf, r)
_, _ = io.Copy(&buf, r)
output := buf.String()

if !strings.Contains(output, "[INFO]") {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func setupInterruptHandler() {
fmt.Print("\nDo you want to export the results? (Y/n): ")

var response string
fmt.Scanln(&response)
_, _ = fmt.Scanln(&response)

if response == "y" || response == "Y" || response == "" {
modules.PrintResult("Search Interrupted", interruptData.Domain, interruptData.Timeout,
Expand Down
11 changes: 6 additions & 5 deletions modules/resolve_site.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package modules

import (
"fmt"
"github.com/schollz/progressbar/v3"
"ipmap/config"
"sync"

"github.com/schollz/progressbar/v3"
)

func ResolveSite(IPAddress []string, Websites [][]string, DomainTitle string, IPBlocks []string, domain string, con bool, export bool, timeout int, interruptData *InterruptData) {
Expand Down Expand Up @@ -53,21 +54,21 @@ func ResolveSite(IPAddress []string, Websites [][]string, DomainTitle string, IP
interruptData.AddWebsite(site)
}

if DomainTitle != "" && site[2] == DomainTitle && con == false {
bar.Finish()
if DomainTitle != "" && site[2] == DomainTitle && !con {
_ = bar.Finish()
PrintResult("Search Domain by ASN", DomainTitle, timeout, IPBlocks, Websites, export)
return
}
}

mu.Lock()
bar.Add(1)
_ = bar.Add(1)
mu.Unlock()
}(ip)
}

wg.Wait()
bar.Finish()
_ = bar.Finish()

// Process and print results
PrintResult("Search All ASN/IP", DomainTitle, timeout, IPBlocks, Websites, export)
Expand Down
2 changes: 1 addition & 1 deletion modules/result_print_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestResultDataJSONOmitEmpty(t *testing.T) {

// Verify omitempty works
var decoded map[string]interface{}
json.Unmarshal(jsonData, &decoded)
_ = json.Unmarshal(jsonData, &decoded)

if _, exists := decoded["search_site"]; exists {
t.Error("search_site should be omitted when empty")
Expand Down
Loading