Fix macOS build

staticcheck used to fail on macOS (and presumably windows) due to a
variable declared in a common package that was only used by the Linux
build, which would prevent `redo pr` from passing on Mac. Moved variable
declaration from the common file to the Linux-specific one to resolve
the compiler complaint.

Signed-off-by: Wendi Yu <wendi.yu@yahoo.ca>
pull/369/head
Wendi Yu 5 years ago committed by Brad Fitzpatrick
parent e16f7e48a3
commit fde384b359

@ -21,8 +21,6 @@ type Port struct {
// List is a list of Ports.
type List []Port
var protos = []string{"tcp", "udp"}
func (a *Port) lessThan(b *Port) bool {
if a.Port < b.Port {
return true

@ -24,6 +24,7 @@ const pollInterval = 1 * time.Second
// TODO(apenwarr): Include IPv6 ports eventually.
// Right now we don't route IPv6 anyway so it's better to exclude them.
var sockfiles = []string{"/proc/net/tcp", "/proc/net/udp"}
var protos = []string{"tcp", "udp"}
func listPorts() (List, error) {
l := []Port{}

Loading…
Cancel
Save