This is the command that i execute
$ ps -e
PID PPID PGID WINPID TTY UID STIME COMMAND
4372 1 4372 4372 ? 197608 03:44:57 /usr/bin/mintty
6476 4372 6476 6208 pty0 197608 03:44:58 /usr/bin/bash
14484 6476 14484 12888 pty0 197608 13:23:48 /usr/bin/ps
I get 1d array of strings using bufio
scanner.scanLines. I need to convert this into array of structs:
type ProcessInfo struct {
PID string `json:"PID"`
PPID string `json:"PPID"`
PGID string `json:"PGID"`
WINPID string `json:"WINPID"`
TTY string `json:"TTY"`
UID string `json:"UID"`
STIME string `json:"STIME"`
COMMAND string `json:"COMMAND"`
}
Any help would be appreciated.