Skip to content

Commit

Permalink
fix: golint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
braginini committed Jun 24, 2021
1 parent 0e313ee commit 561bd68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ func (conn *Connection) Open(timeout time.Duration) error {
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())
err = conn.wgProxy.StartLocal(fmt.Sprintf("%s:%d", pair.Remote.Address(), iface.WgPort))
if err != nil {
return err
}
} else {
err = conn.wgProxy.Start(remoteConn)
if err != nil {
Expand Down
12 changes: 7 additions & 5 deletions iface/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ func elfMap(root string) (map[string]string, error) {
err := filepath.Walk(
root,
func(path string, info os.FileInfo, err error) error {

if err != nil {
// skip broken files
return nil
}

if !info.Mode().IsRegular() {
return nil
}
Expand Down Expand Up @@ -118,11 +124,7 @@ func generateMap() (map[string]string, error) {
// WireguardModExists returns true if Wireguard kernel module exists.
func WireguardModExists() bool {
_, err := resolveModName("wireguard")
if err != nil {
return false
}

return true
return err == nil
}

// resolveModName will, given a module name (such as `wireguard`) return an absolute
Expand Down

0 comments on commit 561bd68

Please sign in to comment.