Skip to content

Commit

Permalink
style: fix ci lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
YYCoder committed Feb 8, 2021
1 parent e867f81 commit 9e082ec
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions gowatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func Autobuild(files []string) {
}
}

// Kill
// Kill kill main process and all its children
func Kill() {
defer func() {
if e := recover(); e != nil {
Expand Down Expand Up @@ -194,7 +194,7 @@ func killAllProcesses(pid int) (err error) {
log.Debugf("pids: %+v", pids)

for _, subPid := range pids {
killProcess(subPid)
_ = killProcess(subPid)
}

waitForProcess(pid, hasAllKilled)
Expand Down Expand Up @@ -225,7 +225,7 @@ func killProcess(pid int) (err error) {
// retry
time.AfterFunc(2*time.Second, func() {
log.Debugf("retry killing process pid: %d", pid)
killProcess(pid)
_ = killProcess(pid)
})
return
}
Expand Down Expand Up @@ -257,7 +257,7 @@ func psTree(rootPid int) (res []int, err error) {
}
}

for pid, _ := range pidOfInterest {
for pid := range pidOfInterest {
if pid != rootPid {
res = append(res, pid)
}
Expand All @@ -266,7 +266,7 @@ func psTree(rootPid int) (res []int, err error) {
return
}

func waitForProcess(pid int, hasAllKilled chan bool) (err error) {
func waitForProcess(pid int, hasAllKilled chan bool) {
pids, _ := psTree(pid)
if len(pids) == 0 {
hasAllKilled <- true
Expand All @@ -277,7 +277,6 @@ func waitForProcess(pid int, hasAllKilled chan bool) (err error) {
time.AfterFunc(time.Second, func() {
waitForProcess(pid, hasAllKilled)
})
return
}

// Restart restart app
Expand Down

0 comments on commit 9e082ec

Please sign in to comment.