From 1e14eea871e903e984e484ce88227fa7207aea5c Mon Sep 17 00:00:00 2001 From: Daisuke Maki Date: Mon, 13 Mar 2017 17:34:59 +0900 Subject: [PATCH] make sure to use WithCancel (and be pedantic) --- cmd/peco/peco.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/peco/peco.go b/cmd/peco/peco.go index 9538cee..49cc5d5 100644 --- a/cmd/peco/peco.go +++ b/cmd/peco/peco.go @@ -29,7 +29,8 @@ func _main() int { if envvar := os.Getenv("GOMAXPROCS"); envvar == "" { runtime.GOMAXPROCS(runtime.NumCPU()) } - ctx := context.Background() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() cli := peco.New() if err := cli.Run(ctx); err != nil {