File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -15,32 +15,32 @@ const (
1515
1616// IsIPv4 returns true if the address family is IPv4 (AF_INET4), false otherwise.
1717func (ap AddressFamilyAndProtocol ) IsIPv4 () bool {
18- return 0x10 == ap & 0xF0
18+ return ap & 0xF0 == 0x10
1919}
2020
2121// IsIPv6 returns true if the address family is IPv6 (AF_INET6), false otherwise.
2222func (ap AddressFamilyAndProtocol ) IsIPv6 () bool {
23- return 0x20 == ap & 0xF0
23+ return ap & 0xF0 == 0x20
2424}
2525
2626// IsUnix returns true if the address family is UNIX (AF_UNIX), false otherwise.
2727func (ap AddressFamilyAndProtocol ) IsUnix () bool {
28- return 0x30 == ap & 0xF0
28+ return ap & 0xF0 == 0x30
2929}
3030
3131// IsStream returns true if the transport protocol is TCP or STREAM (SOCK_STREAM), false otherwise.
3232func (ap AddressFamilyAndProtocol ) IsStream () bool {
33- return 0x01 == ap & 0x0F
33+ return ap & 0x0F == 0x01
3434}
3535
3636// IsDatagram returns true if the transport protocol is UDP or DGRAM (SOCK_DGRAM), false otherwise.
3737func (ap AddressFamilyAndProtocol ) IsDatagram () bool {
38- return 0x02 == ap & 0x0F
38+ return ap & 0x0F == 0x02
3939}
4040
4141// IsUnspec returns true if the transport protocol or address family is unspecified, false otherwise.
4242func (ap AddressFamilyAndProtocol ) IsUnspec () bool {
43- return (0x00 == ap & 0xF0 ) || (0x00 == ap & 0x0F )
43+ return (ap & 0xF0 == 0x00 ) || (ap & 0x0F == 0x00 )
4444}
4545
4646func (ap AddressFamilyAndProtocol ) toByte () byte {
You can’t perform that action at this time.
0 commit comments