From 01da49db25c2cb6c215caae94dec5e40bbcdb710 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg <42micro@gmail.com> Date: Thu, 7 Jul 2016 21:56:44 -0400 Subject: [PATCH] Change defer to explicit function call before os.Exit() --- cmd/hoarder/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/hoarder/main.go b/cmd/hoarder/main.go index 348a181..eebb5d3 100644 --- a/cmd/hoarder/main.go +++ b/cmd/hoarder/main.go @@ -62,7 +62,6 @@ func main() { logger.Printf("Unable to open RPC socket file '%s': '%s'", config.RPCSocketPath, err) os.Exit(1) } - defer rpc.Close() reply := "" err = rpc.Call("Status.Downloads", &queue.RPCArgs{}, &reply) @@ -76,6 +75,8 @@ func main() { } else { fmt.Println("No Downloads") } + + rpc.Close() os.Exit(0) }