From 59a52fe80a4f60a2795fde3595c215c6186f4abc Mon Sep 17 00:00:00 2001 From: Norihiro NAKAOKA Date: Tue, 6 Apr 2021 15:09:55 +0900 Subject: [PATCH] change WithSourcePort argument type (#77) --- nmap.go | 2 +- nmap_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nmap.go b/nmap.go index 874cc17..ad0cceb 100644 --- a/nmap.go +++ b/nmap.go @@ -1314,7 +1314,7 @@ func WithInterface(iface string) Option { } // WithSourcePort specifies from which port to scan. -func WithSourcePort(port int16) Option { +func WithSourcePort(port uint16) Option { return func(s *Scanner) { s.args = append(s.args, "--source-port") s.args = append(s.args, fmt.Sprint(port)) diff --git a/nmap_test.go b/nmap_test.go index 10db2df..be60926 100644 --- a/nmap_test.go +++ b/nmap_test.go @@ -1707,12 +1707,12 @@ func TestFirewallAndIDSEvasionAndSpoofing(t *testing.T) { description: "set source port", options: []Option{ - WithSourcePort(4242), + WithSourcePort(65535), }, expectedArgs: []string{ "--source-port", - "4242", + "65535", }, }, {