mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -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
|
@ -151,13 +151,13 @@ func (f PfFirewall) EnableRedirection(r *Redirection, enabled bool) error {
|
|||
lines := ""
|
||||
scanner := bufio.NewScanner(fd)
|
||||
for scanner.Scan() {
|
||||
line := strings.Trim(scanner.Text(), "\r\n\t ")
|
||||
line := core.Trim(scanner.Text())
|
||||
if line != rule {
|
||||
lines += line + "\n"
|
||||
}
|
||||
}
|
||||
|
||||
if strings.Trim(lines, "\r\n\t ") == "" {
|
||||
if core.Trim(lines) == "" {
|
||||
os.Remove(f.filename)
|
||||
f.enable(false)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue