check for and handle errors

pull/8101/head
Megan Marsh 7 years ago
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…
Cancel
Save