Skip to content

Commit

Permalink
Fix typo where port number was appended to host
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Dec 30, 2015
1 parent 1c8d04c commit 86ed9ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netstatus/netstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func PortOpen(protocol string, port uint16) bool {
if err != nil {
log.Fatal(err)
}
return CanConnect("localhost"+fmt.Sprint(port), protocol, dur)
return CanConnect(fmt.Sprintf("localhost:%v", port), protocol, dur)
}

// ValidIP returns a boolean answering the question "is this a valid IPV4/6
Expand Down
2 changes: 1 addition & 1 deletion netstatus/netstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestOpenPorts(t *testing.T) {
t.Errorf(msg+": %d", port)
} else {
dur, _ := time.ParseDuration("10s")
if CanConnect("localhost:"+fmt.Sprint(port), protocol, dur) {
if CanConnect(fmt.Sprintf("localhost:%v", port), protocol, dur) {
couldConnect++
}
}
Expand Down

0 comments on commit 86ed9ab

Please sign in to comment.