Skip to content

Commit 1bef796

Browse files
authored
fix: remove outdated example test (#135)
1 parent 282fbd9 commit 1bef796

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

examples_test.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,3 @@ func ExampleScanner_simple() {
3131
)
3232
// Output: Scan successful: 3 hosts up
3333
}
34-
35-
// A scanner can be given custom idiomatic filters for both hosts
36-
// and ports.
37-
func ExampleScanner_filters() {
38-
s, err := NewScanner(
39-
context.Background(),
40-
WithTargets("google.com", "facebook.com"),
41-
WithPorts("843"),
42-
WithFilterHost(func(h Host) bool {
43-
// Filter out hosts with no open ports.
44-
for idx := range h.Ports {
45-
if h.Ports[idx].Status() == "closed" {
46-
return true
47-
}
48-
}
49-
return false
50-
}),
51-
)
52-
if err != nil {
53-
log.Fatalf("unable to create nmap scanner: %v", err)
54-
}
55-
56-
scanResult, _, err := s.Run()
57-
if err != nil {
58-
log.Fatalf("nmap encountered an error: %v", err)
59-
}
60-
61-
fmt.Printf(
62-
"Filtered out hosts %d / Original number of hosts: %d\n",
63-
len(scanResult.Hosts),
64-
scanResult.Stats.Hosts.Total,
65-
)
66-
// Output: Filtered out hosts 1 / Original number of hosts: 2
67-
}

0 commit comments

Comments
 (0)