Skip to content

Commit

Permalink
Merge pull request #123 from CiscoCloud/fix/portopen-typo
Browse files Browse the repository at this point in the history
Fix typo where port number was appended to host
  • Loading branch information
langston-barrett committed Jan 4, 2016
2 parents 91ea88e + 86ed9ab commit ad8f8b9
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 ad8f8b9

Please sign in to comment.