mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 11:40:33 -07:00
Revert "Minor refactors using golint"
This commit is contained in:
parent
9196be7a8b
commit
5328ced392
21 changed files with 101 additions and 70 deletions
|
@ -66,8 +66,9 @@ func ExecSilent(executable string, args []string) (string, error) {
|
|||
raw, err := exec.Command(path, args...).CombinedOutput()
|
||||
if err != nil {
|
||||
return "", err
|
||||
} else {
|
||||
return Trim(string(raw)), nil
|
||||
}
|
||||
return Trim(string(raw)), nil
|
||||
}
|
||||
|
||||
func Exec(executable string, args []string) (string, error) {
|
||||
|
@ -92,9 +93,10 @@ func ExpandPath(path string) (string, error) {
|
|||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
return "", err
|
||||
} else {
|
||||
// Replace only the first occurrence of ~
|
||||
path = strings.Replace(path, "~", usr.HomeDir, 1)
|
||||
}
|
||||
// Replace only the first occurrence of ~
|
||||
path = strings.Replace(path, "~", usr.HomeDir, 1)
|
||||
}
|
||||
return filepath.Abs(path)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue