Skip to content

Commit 6ad0592

Browse files
committed
refactor: use struct instantiation value
1 parent 7097804 commit 6ad0592

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

pkg/providers/otx/otx.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (c *Client) Name() string {
4747

4848
func (c *Client) Fetch(ctx context.Context, domain string, results chan string) error {
4949
paginate:
50-
for page := 1; ; page++ {
50+
for page := uint(1); ; page++ {
5151
select {
5252
case <-ctx.Done():
5353
break paginate
@@ -75,7 +75,7 @@ paginate:
7575
return nil
7676
}
7777

78-
func (c *Client) formatURL(domain string, page int) string {
78+
func (c *Client) formatURL(domain string, page uint) string {
7979
category := "hostname"
8080
if !domainutil.HasSubdomain(domain) {
8181
category = "domain"

pkg/providers/urlscan/urlscan.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (c *Client) Fetch(ctx context.Context, domain string, results chan string)
4242
}
4343

4444
paginate:
45-
for page := 0; ; page++ {
45+
for page := uint(0); ; page++ {
4646
select {
4747
case <-ctx.Done():
4848
break paginate

pkg/providers/wayback/wayback.go

+5-10
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ type Client struct {
2222
config *providers.Config
2323
}
2424

25-
func New(c *providers.Config, filters providers.Filters) *Client {
26-
return &Client{
27-
filters: filters,
28-
config: c,
29-
}
25+
func New(config *providers.Config, filters providers.Filters) *Client {
26+
return &Client{filters, config}
3027
}
3128

3229
func (c *Client) Name() string {
@@ -69,11 +66,9 @@ func (c *Client) Fetch(ctx context.Context, domain string, results chan string)
6966
}
7067

7168
// output results
72-
for i, entry := range result {
73-
// Skip first result by default
74-
if i != 0 {
75-
results <- entry[0]
76-
}
69+
// Slicing as [1:] to skip first result by default
70+
for _, entry := range result[1:] {
71+
results <- entry[0]
7772
}
7873
}
7974
}

0 commit comments

Comments
 (0)