Skip to content

Commit 4d1055a

Browse files
committed
fix staticcheck lint issues
1 parent 001c870 commit 4d1055a

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

common.go

-16
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,6 @@ import (
1818
"strings"
1919
)
2020

21-
// Pulled from http://man7.org/linux/man-pages/man7/rtnetlink.7.html
22-
// See the section on RTM_NEWROUTE, specifically 'struct rtmsg'.
23-
type routeInfoInMemory struct {
24-
Family byte
25-
DstLen byte
26-
SrcLen byte
27-
TOS byte
28-
29-
Table byte
30-
Protocol byte
31-
Scope byte
32-
Type byte
33-
34-
Flags uint32
35-
}
36-
3721
// rtInfo contains information on a single route.
3822
type rtInfo struct {
3923
Src, Dst *net.IPNet

netroute_bsd.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ func New() (routing.Router, error) {
6969
routeInfo := new(rtInfo)
7070

7171
if m.Version < 3 || m.Version > 5 {
72-
return nil, fmt.Errorf("Unexpected RIB message version: %d", m.Version)
72+
return nil, fmt.Errorf("unexpected RIB message version: %d", m.Version)
7373
}
7474
if m.Type != 4 /* RTM_GET */ {
75-
return nil, fmt.Errorf("Unexpected RIB message type: %d", m.Type)
75+
return nil, fmt.Errorf("unexpected RIB message type: %d", m.Type)
7676
}
7777

7878
if m.Flags&RTF_UP == 0 ||
@@ -95,7 +95,7 @@ func New() (routing.Router, error) {
9595
}
9696
routeInfo.Dst = ipn
9797
} else {
98-
return nil, fmt.Errorf("Unexpected RIB destination: %v", err)
98+
return nil, fmt.Errorf("unexpected RIB destination: %v", err)
9999
}
100100

101101
if m.Flags&RTF_GATEWAY != 0 {

netroute_linux.go

+16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ import (
2020
"github.com/google/gopacket/routing"
2121
)
2222

23+
// Pulled from http://man7.org/linux/man-pages/man7/rtnetlink.7.html
24+
// See the section on RTM_NEWROUTE, specifically 'struct rtmsg'.
25+
type routeInfoInMemory struct {
26+
Family byte
27+
DstLen byte
28+
SrcLen byte
29+
TOS byte
30+
31+
Table byte
32+
Protocol byte
33+
Scope byte
34+
Type byte
35+
36+
Flags uint32
37+
}
38+
2339
func New() (routing.Router, error) {
2440
rtr := &router{}
2541
rtr.ifaces = make(map[int]net.Interface)

0 commit comments

Comments
 (0)