From 4db46a5d3d4e6e1e91a0efcaa3aa94b7ad417f70 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 11 Aug 2021 14:32:10 +0200 Subject: [PATCH] Check error --- cmd/rest-server/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/rest-server/main.go b/cmd/rest-server/main.go index 52f9df9..1de3607 100644 --- a/cmd/rest-server/main.go +++ b/cmd/rest-server/main.go @@ -97,8 +97,11 @@ func runRoot(cmd *cobra.Command, args []string) error { go func() { for range sigintCh { pprof.StopCPUProfile() - f.Close() log.Println("Stopped CPU profiling") + err := f.Close() + if err != nil { + log.Printf("error closing CPU profile file: %v", err) + } os.Exit(130) } }()