check for and handle errors
This commit is contained in:
parent
622be96fa0
commit
aa8b9164a3
|
@ -3,11 +3,16 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/shirou/gopsutil/process"
|
||||
)
|
||||
|
||||
func checkProcess(currentPID int) (bool, error) {
|
||||
myProc, _ := process.NewProcess(int32(currentPID))
|
||||
myProc, err := process.NewProcess(int32(currentPID))
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("Error figuring out Packer process info")
|
||||
}
|
||||
bg, _ := myProc.Background()
|
||||
|
||||
return bg, nil
|
||||
|
|
Loading…
Reference in New Issue