Skip to content

Commit

Permalink
Fixing linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
john-westcott-iv committed Jan 21, 2022
1 parent a8ffb72 commit d603d20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/netceptor/netceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,11 @@ func (s *Netceptor) MaxConnectionIdleTime() time.Duration {

// Convert the connection type to a string.
func (s *Netceptor) GetConnectionTypeAsString(connectionType byte) string {
// A byte can't be < 0 so we don't need to check the lower bounds
// A byte can't be < 0 so we don't need to check the lower bounds
if connectionType < byte(len(ConnTypeStrings)) {
return ConnTypeStrings[connectionType]
}

return "Unknown"
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/netceptor/netceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ func TestConnTypeString(t *testing.T) {
if ConnTypeStrings[ConnTypeDatagram] != n1.GetConnectionTypeAsString(0) {
t.Fatal("Datagram should be the first entry in ConnTypeStrings")
}
if "Unknown" != n1.GetConnectionTypeAsString(254) {
if n1.GetConnectionTypeAsString(254) != "Unknown" {
t.Fatal("Either we now have 254 ConnTypes or GetConnectionTypeAsString did not properly return Unknown")
}
// Shutdown the network
Expand Down

0 comments on commit d603d20

Please sign in to comment.