Skip to content

Commit

Permalink
feat(gau): add concurrency for domains
Browse files Browse the repository at this point in the history
  • Loading branch information
lc committed Jun 3, 2021
1 parent 6663f6c commit 0eac26a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.14
require (
github.com/bobesa/go-domain-util v0.0.0-20190911083921-4033b5f7dd89
github.com/json-iterator/go v1.1.10
github.com/remeh/sizedwaitgroup v1.0.0 // indirect
github.com/remeh/sizedwaitgroup v1.0.0
)
5 changes: 3 additions & 2 deletions output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
type JSONResult struct {
Url string `json:"url"`
}

func WriteURLs(results <-chan string, writer io.Writer, blacklistMap map[string]struct{}) error {
wr := bufio.NewWriter(writer)
str := &strings.Builder{}
Expand All @@ -22,7 +23,7 @@ func WriteURLs(results <-chan string, writer io.Writer, blacklistMap map[string]
if err != nil {
continue
}
base := strings.Split(path.Base(u.Path),".")
base := strings.Split(path.Base(u.Path), ".")
ext := base[len(base)-1]
if ext != "" {
_, ok := blacklistMap[strings.ToLower(ext)]
Expand Down Expand Up @@ -51,7 +52,7 @@ func WriteURLsJSON(results <-chan string, writer io.Writer, blacklistMap map[str
if err != nil {
continue
}
base := strings.Split(path.Base(u.Path),".")
base := strings.Split(path.Base(u.Path), ".")
ext := base[len(base)-1]
if ext != "" {
_, ok := blacklistMap[strings.ToLower(ext)]
Expand Down
2 changes: 1 addition & 1 deletion providers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ func (c *CommonProvider) Fetch(domain string, results chan<- string) error {
}

return nil
}
}
2 changes: 1 addition & 1 deletion providers/otx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package providers
import (
"encoding/json"
"fmt"
"strings"
"github.com/bobesa/go-domain-util/domainutil"
"strings"
)

type OTXProvider struct {
Expand Down

0 comments on commit 0eac26a

Please sign in to comment.