wgengine: fix macos staticcheck errors (#557)

Signed-off-by: Wendi <wendi.yu@yahoo.ca>
This commit is contained in:
Wendi Yu 2020-07-14 17:28:02 -06:00 committed by GitHub
parent d9ac2ada45
commit c3736250a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 16 deletions

View File

@ -20,13 +20,6 @@ type message interface {
ignore() bool
}
// unspecifiedMessage is a minimal message implementation that should not
// be ignored. In general, OS-specific implementations should use better
// types and avoid this if they can.
type unspecifiedMessage struct{}
func (unspecifiedMessage) ignore() bool { return false }
// osMon is the interface that each operating system-specific
// implementation of the link monitor must implement.
type osMon interface {

View File

@ -13,6 +13,13 @@
"tailscale.com/types/logger"
)
// unspecifiedMessage is a minimal message implementation that should not
// be ignored. In general, OS-specific implementations should use better
// types and avoid this if they can.
type unspecifiedMessage struct{}
func (unspecifiedMessage) ignore() bool { return false }
// devdConn implements osMon using devd(8).
type devdConn struct {
conn net.Conn

View File

@ -19,6 +19,13 @@
"tailscale.com/types/logger"
)
// unspecifiedMessage is a minimal message implementation that should not
// be ignored. In general, OS-specific implementations should use better
// types and avoid this if they can.
type unspecifiedMessage struct{}
func (unspecifiedMessage) ignore() bool { return false }
// nlConn wraps a *netlink.Conn and returns a monitor.Message
// instead of a netlink.Message. Currently, messages are discarded,
// but down the line, when messages trigger different logic depending

View File

@ -5,8 +5,6 @@
package router
import (
"time"
"inet.af/netaddr"
)
@ -46,13 +44,6 @@ func (lhs DNSConfig) EquivalentTo(rhs DNSConfig) bool {
return true
}
// dnsReconfigTimeout is the timeout for DNS reconfiguration.
//
// This is useful because certain conditions can cause indefinite hangs
// (such as improper dbus auth followed by contextless dbus.Object.Call).
// Such operations should be wrapped in a timeout context.
const dnsReconfigTimeout = time.Second
// dnsMode determines how DNS settings are managed.
type dnsMode uint8

View File

@ -11,6 +11,7 @@
"errors"
"fmt"
"os/exec"
"time"
"github.com/godbus/dbus/v5"
"golang.org/x/sys/unix"
@ -35,6 +36,13 @@
// this address is, in fact, hard-coded into resolved.
var resolvedListenAddr = netaddr.IPv4(127, 0, 0, 53)
// dnsReconfigTimeout is the timeout for DNS reconfiguration.
//
// This is useful because certain conditions can cause indefinite hangs
// (such as improper dbus auth followed by contextless dbus.Object.Call).
// Such operations should be wrapped in a timeout context.
const dnsReconfigTimeout = time.Second
var errNotReady = errors.New("interface not ready")
type resolvedLinkNameserver struct {