Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
firefart committed May 9, 2022
1 parent 5ba5818 commit 46e144d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linters:
enable:
- nonamedreturns
2 changes: 1 addition & 1 deletion internal/helpers_turn.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func ConvertXORAddr(input []byte, transactionID string) (string, uint16, error)
return "", 0, fmt.Errorf("invalid buffer length %d, need to be > 4", len(input))
}
family := input[0:2] // 0x0001 = ipv4, 0x0002 = ipv6
if bytes.Compare(family, []byte{00, 01}) != 0 && bytes.Compare(family, []byte{00, 02}) != 0 {
if !bytes.Equal(family, []byte{00, 01}) && !bytes.Equal(family, []byte{00, 02}) {
return "", 0, fmt.Errorf("invalid family %02x", family)
}
portRaw := input[2:4]
Expand Down

0 comments on commit 46e144d

Please sign in to comment.