From 6f3dcba5ff8f8cb6925b39faa7471ab018419cfa Mon Sep 17 00:00:00 2001 From: ComixHe Date: Fri, 27 Oct 2023 16:21:22 +0800 Subject: [PATCH] fix: return value should be the value passed on cancelation Signed-off-by: ComixHe --- pkg/cgfsmon/public.go | 2 +- pkg/routeman/public.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cgfsmon/public.go b/pkg/cgfsmon/public.go index 6b590a9..d3b8736 100644 --- a/pkg/cgfsmon/public.go +++ b/pkg/cgfsmon/public.go @@ -60,7 +60,7 @@ LOOP: } <-ctx.Done() - err = ctx.Err() + err = context.Cause(ctx) if err != nil { return } diff --git a/pkg/routeman/public.go b/pkg/routeman/public.go index 89d0427..f6fa0f5 100644 --- a/pkg/routeman/public.go +++ b/pkg/routeman/public.go @@ -49,5 +49,5 @@ func (m *RouteManager) RunRouteManager(ctx context.Context) (err error) { } <-ctx.Done() - return ctx.Err() + return context.Cause(ctx) }