Skip to content

Commit

Permalink
update sdk unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar committed Jul 26, 2024
1 parent 3807836 commit 0e827a6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/advanced/advanced.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
package main

import (
"context"

nuclei "github.com/projectdiscovery/nuclei/v3/lib"
"github.com/projectdiscovery/nuclei/v3/pkg/installer"
syncutil "github.com/projectdiscovery/utils/sync"
)

func main() {
ctx := context.Background()
// when running nuclei in parallel for first time it is a good practice to make sure
// templates exists first
tm := installer.TemplateManager{}
if err := tm.FreshInstallIfNotExists(); err != nil {
panic(err)
}

// create nuclei engine with options
ne, err := nuclei.NewThreadSafeNucleiEngine()
ne, err := nuclei.NewThreadSafeNucleiEngineCtx(ctx)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 0e827a6

Please sign in to comment.