File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ func (host *DiscoveredHost) CheckPing() error {
108108 pinger .Run ()
109109 stats := pinger .Statistics ()
110110 if stats .PacketsRecv == 0 {
111- return fmt .Errorf ("Host unreachable for " + host .IP )
111+ return fmt .Errorf ("host unreachable for %s" , host .IP )
112112 }
113113 host .Ping = int (stats .AvgRtt .Milliseconds ())
114114 return nil
@@ -136,7 +136,7 @@ func (host *DiscoveredHost) ScanPorts(startPort, endPort int) []int {
136136 var openPorts []int
137137
138138 for port := startPort ; port <= endPort ; port ++ {
139- target := fmt .Sprintf ("%s:% d" , host . IP , port )
139+ target := net . JoinHostPort ( host . IP , fmt .Sprintf ("%d" , port ) )
140140 conn , err := net .DialTimeout ("tcp" , target , time .Millisecond * 500 )
141141 if err == nil {
142142 conn .Close ()
You can’t perform that action at this time.
0 commit comments