diff --git a/internal/common/common_darwin.go b/internal/common/common_darwin.go index ef88936..2c15b78 100644 --- a/internal/common/common_darwin.go +++ b/internal/common/common_darwin.go @@ -11,7 +11,10 @@ import ( ) func DoSysctrl(mib string) ([]string, error) { - os.Setenv("LC_ALL", "C") + err := os.Setenv("LC_ALL", "C") + if err != nil { + return []string{}, err + } out, err := exec.Command("/usr/sbin/sysctl", "-n", mib).Output() if err != nil { return []string{}, err diff --git a/internal/common/common_freebsd.go b/internal/common/common_freebsd.go index ef7b914..ef9ca56 100644 --- a/internal/common/common_freebsd.go +++ b/internal/common/common_freebsd.go @@ -11,7 +11,10 @@ import ( ) func DoSysctrl(mib string) ([]string, error) { - os.Setenv("LC_ALL", "C") + err := os.Setenv("LC_ALL", "C") + if err != nil { + return []string{}, err + } out, err := exec.Command("/sbin/sysctl", "-n", mib).Output() if err != nil { return []string{}, err diff --git a/process/process_darwin.go b/process/process_darwin.go index a40034a..8e4d518 100644 --- a/process/process_darwin.go +++ b/process/process_darwin.go @@ -327,11 +327,6 @@ func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { return &ret, common.NotImplementedError } -func copyParams(k *KinfoProc, p *Process) error { - - return nil -} - func processes() ([]Process, error) { results := make([]Process, 0, 50) @@ -364,8 +359,6 @@ func processes() ([]Process, error) { if err != nil { continue } - copyParams(&k, p) - results = append(results, *p) }