From 76aabc369233bc27591b9ddc57adeb4c1e67302c Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Wed, 20 Nov 2024 14:56:36 +0800 Subject: [PATCH] fix: code warnings --- core/task/handler/runner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/task/handler/runner.go b/core/task/handler/runner.go index ffe7d621..f83202e3 100644 --- a/core/task/handler/runner.go +++ b/core/task/handler/runner.go @@ -182,10 +182,10 @@ func (r *Runner) Cancel(force bool) (err error) { for { select { case <-timeout: - return errors.New(fmt.Sprintf("task process %d still exists", r.pid)) + return fmt.Errorf("task process %d still exists", r.pid) case <-ticker.C: if exists, _ := process.PidExists(int32(r.pid)); exists { - return errors.New(fmt.Sprintf("task process %d still exists", r.pid)) + return fmt.Errorf("task process %d still exists", r.pid) } return nil }