Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir committed Jan 11, 2024
1 parent bb906ff commit 34d351e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion v2/examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"context"
"io"
"log"
"strconv"

"github.com/projectdiscovery/subfinder/v2/pkg/runner"
contextutil "github.com/projectdiscovery/utils/context"
)

func main() {
Expand All @@ -31,7 +33,8 @@ func main() {

output := &bytes.Buffer{}
// To run subdomain enumeration on a single domain
if err = subfinder.EnumerateSingleDomainWithCtx(context.Background(), "hackerone.com", []io.Writer{output}); err != nil {
ctx, _ := contextutil.WithValues(context.Background(), contextutil.ContextArg("All"), contextutil.ContextArg(strconv.FormatBool(subfinderOpts.All)))
if err = subfinder.EnumerateSingleDomainWithCtx(ctx, "hackerone.com", []io.Writer{output}); err != nil {
log.Fatalf("failed to enumerate single domain: %v", err)
}

Expand Down

0 comments on commit 34d351e

Please sign in to comment.