From 313544bde60f7bbaba7cde41082d91a7631437d4 Mon Sep 17 00:00:00 2001 From: "Iskander (Alex) Sharipov" Date: Fri, 14 Sep 2018 01:50:11 +0100 Subject: [PATCH] remove unnecessary wrapping lambda, use function value directly (#372) Found using https://go-critic.github.io/overview#unlambda-ref --- main.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index fc54aec..9fe5afd 100644 --- a/main.go +++ b/main.go @@ -232,23 +232,15 @@ func main() { var g errgroup.Group - g.Go(func() error { - return gorush.InitAPNSClient() - }) + g.Go(gorush.InitAPNSClient) g.Go(func() error { _, err := gorush.InitFCMClient(gorush.PushConf.Android.APIKey) return err }) - g.Go(func() error { - // Run httpd server - return gorush.RunHTTPServer() - }) - g.Go(func() error { - // Run gRPC internal server - return rpc.RunGRPCServer() - }) + g.Go(gorush.RunHTTPServer) // Run httpd server + g.Go(rpc.RunGRPCServer) // Run gRPC internal server if err = g.Wait(); err != nil { gorush.LogError.Fatal(err)