mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
more lint driven refactoring
This commit is contained in:
parent
0de6f3a76e
commit
1afab5d7be
7 changed files with 19 additions and 26 deletions
|
@ -133,7 +133,7 @@ func buildEndpointFromInterface(iface net.Interface) (*Endpoint, error) {
|
|||
for _, a := range addrs {
|
||||
address := a.String()
|
||||
if IPv4Validator.MatchString(address) {
|
||||
if strings.IndexRune(address, '/') == -1 {
|
||||
if strings.ContainsRune(address, '/') {
|
||||
// plain ip
|
||||
e.SetIP(address)
|
||||
} else {
|
||||
|
@ -201,7 +201,7 @@ func FindInterface(name string) (*Endpoint, error) {
|
|||
|
||||
for _, address := range addrs {
|
||||
ip := address.String()
|
||||
if strings.Contains(ip, "127.0.0.1") == false && IPv4Validator.MatchString(ip) {
|
||||
if !strings.Contains(ip, "127.0.0.1") && IPv4Validator.MatchString(ip) {
|
||||
return buildEndpointFromInterface(iface)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue