Fix lint refactoring failures for cross-compile files
This commit is contained in:
parent
07f1fe5fe8
commit
3487bbfaed
|
@ -16,7 +16,7 @@ type processList struct {
|
||||||
Process []struct {
|
Process []struct {
|
||||||
Pid string `json:"pid"`
|
Pid string `json:"pid"`
|
||||||
Comm string `json:"command"`
|
Comm string `json:"command"`
|
||||||
Cpu string `json:"percent-cpu" `
|
CPU string `json:"percent-cpu" `
|
||||||
Mem string `json:"percent-memory" `
|
Mem string `json:"percent-memory" `
|
||||||
Args string `json:"arguments" `
|
Args string `json:"arguments" `
|
||||||
} `json:"process"`
|
} `json:"process"`
|
||||||
|
@ -44,7 +44,7 @@ func getProcs() ([]Proc, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to convert first field to int: %v. split: %v", err, process)
|
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 {
|
if err != nil {
|
||||||
log.Printf("failed to convert third field to float: %v. split: %v", err, process)
|
log.Printf("failed to convert third field to float: %v. split: %v", err, process)
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ func getProcs() ([]Proc, error) {
|
||||||
proc := Proc{
|
proc := Proc{
|
||||||
Pid: pid,
|
Pid: pid,
|
||||||
CommandName: process.Comm,
|
CommandName: process.Comm,
|
||||||
Cpu: cpu,
|
CPU: cpu,
|
||||||
Mem: mem,
|
Mem: mem,
|
||||||
FullCommand: process.Args,
|
FullCommand: process.Args,
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ func getProcs() ([]Proc, error) {
|
||||||
proc := Proc{
|
proc := Proc{
|
||||||
Pid: pid,
|
Pid: pid,
|
||||||
CommandName: strings.TrimSpace(line[11:61]),
|
CommandName: strings.TrimSpace(line[11:61]),
|
||||||
Cpu: cpu,
|
CPU: cpu,
|
||||||
Mem: mem,
|
Mem: mem,
|
||||||
FullCommand: line[74:],
|
FullCommand: line[74:],
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ func getProcs() ([]Proc, error) {
|
||||||
procs[i] = Proc{
|
procs[i] = Proc{
|
||||||
Pid: int(pid),
|
Pid: int(pid),
|
||||||
CommandName: command,
|
CommandName: command,
|
||||||
Cpu: cpu,
|
CPU: cpu,
|
||||||
Mem: float64(mem),
|
Mem: float64(mem),
|
||||||
// getting command args using gopsutil's Cmdline and CmdlineSlice wasn't
|
// getting command args using gopsutil's Cmdline and CmdlineSlice wasn't
|
||||||
// working the last time I tried it, so we're just reusing 'command'
|
// working the last time I tried it, so we're just reusing 'command'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user