mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-25 04:01:29 +02:00
fix: golint errors
This commit is contained in:
parent
0e313eec24
commit
561bd681d9
@ -154,6 +154,9 @@ func (conn *Connection) Open(timeout time.Duration) error {
|
|||||||
if pair.Local.Type() == ice.CandidateTypeHost && pair.Remote.Type() == ice.CandidateTypeHost {
|
if pair.Local.Type() == ice.CandidateTypeHost && pair.Remote.Type() == ice.CandidateTypeHost {
|
||||||
log.Debugf("remote peer %s is in the local network with an address %s", conn.Config.RemoteWgKey.String(), pair.Remote.Address())
|
log.Debugf("remote peer %s is in the local network with an address %s", conn.Config.RemoteWgKey.String(), pair.Remote.Address())
|
||||||
err = conn.wgProxy.StartLocal(fmt.Sprintf("%s:%d", pair.Remote.Address(), iface.WgPort))
|
err = conn.wgProxy.StartLocal(fmt.Sprintf("%s:%d", pair.Remote.Address(), iface.WgPort))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
err = conn.wgProxy.Start(remoteConn)
|
err = conn.wgProxy.Start(remoteConn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
12
iface/mod.go
12
iface/mod.go
@ -83,6 +83,12 @@ func elfMap(root string) (map[string]string, error) {
|
|||||||
err := filepath.Walk(
|
err := filepath.Walk(
|
||||||
root,
|
root,
|
||||||
func(path string, info os.FileInfo, err error) error {
|
func(path string, info os.FileInfo, err error) error {
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
// skip broken files
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if !info.Mode().IsRegular() {
|
if !info.Mode().IsRegular() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -118,11 +124,7 @@ func generateMap() (map[string]string, error) {
|
|||||||
// WireguardModExists returns true if Wireguard kernel module exists.
|
// WireguardModExists returns true if Wireguard kernel module exists.
|
||||||
func WireguardModExists() bool {
|
func WireguardModExists() bool {
|
||||||
_, err := resolveModName("wireguard")
|
_, err := resolveModName("wireguard")
|
||||||
if err != nil {
|
return err == nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolveModName will, given a module name (such as `wireguard`) return an absolute
|
// resolveModName will, given a module name (such as `wireguard`) return an absolute
|
||||||
|
Loading…
x
Reference in New Issue
Block a user