mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
refact: refactored several strings.Trim calls to core.Trim
This commit is contained in:
parent
5189068cd3
commit
ca9f4f0945
10 changed files with 35 additions and 23 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/evilsocket/bettercap-ng/core"
|
||||
"github.com/evilsocket/bettercap-ng/log"
|
||||
|
@ -53,7 +52,7 @@ func NewWOL(s *session.Session) *WOL {
|
|||
func parseMAC(args []string) (string, error) {
|
||||
mac := "ff:ff:ff:ff:ff:ff"
|
||||
if len(args) == 1 {
|
||||
tmp := strings.Trim(args[0], "\r\n\t ")
|
||||
tmp := core.Trim(args[0])
|
||||
if tmp != "" {
|
||||
if reMAC.MatchString(tmp) == false {
|
||||
return "", fmt.Errorf("%s is not a valid MAC address.", tmp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue