Fix lint refactoring failures for cross-compile files

This commit is contained in:
Sean E. Russell 2020-04-28 13:23:50 -05:00
parent 07f1fe5fe8
commit 3487bbfaed
3 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ type processList struct {
Process []struct {
Pid string `json:"pid"`
Comm string `json:"command"`
Cpu string `json:"percent-cpu" `
CPU string `json:"percent-cpu" `
Mem string `json:"percent-memory" `
Args string `json:"arguments" `
} `json:"process"`
@ -44,7 +44,7 @@ func getProcs() ([]Proc, error) {
if err != nil {
log.Printf("failed to convert first field to int: %v. split: %v", err, process)
}
cpu, err := strconv.ParseFloat(utils.ConvertLocalizedString(process.Cpu), 32)
cpu, err := strconv.ParseFloat(utils.ConvertLocalizedString(process.CPU), 32)
if err != nil {
log.Printf("failed to convert third field to float: %v. split: %v", err, process)
}
@ -55,7 +55,7 @@ func getProcs() ([]Proc, error) {
proc := Proc{
Pid: pid,
CommandName: process.Comm,
Cpu: cpu,
CPU: cpu,
Mem: mem,
FullCommand: process.Args,
}

View File

@ -46,7 +46,7 @@ func getProcs() ([]Proc, error) {
proc := Proc{
Pid: pid,
CommandName: strings.TrimSpace(line[11:61]),
Cpu: cpu,
CPU: cpu,
Mem: mem,
FullCommand: line[74:],
}

View File

@ -32,7 +32,7 @@ func getProcs() ([]Proc, error) {
procs[i] = Proc{
Pid: int(pid),
CommandName: command,
Cpu: cpu,
CPU: cpu,
Mem: float64(mem),
// getting command args using gopsutil's Cmdline and CmdlineSlice wasn't
// working the last time I tried it, so we're just reusing 'command'