From 30e3d0e012c72d2f3bf8d48d79d07846166e729e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 17 Jan 2023 19:24:19 +0100 Subject: [PATCH] main.go: Remove some global variables that does not need to be global. --- main.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index b104d74..494c62c 100644 --- a/main.go +++ b/main.go @@ -31,15 +31,8 @@ import ( var conf config.Config -var chainInfo *eos.InfoResp - var shClient *shipclient.ShipClient -var ( - eosClient *eos.API - eosClientCtx = context.Background() -) - var abi_mgr *abi.AbiManager var publisher transport.Publisher @@ -171,6 +164,7 @@ func init() { func main() { var err error + var chainInfo *eos.InfoResp showHelp := getopt.BoolLong("help", 'h', "display this help text") showVersion := getopt.BoolLong("version", 'v', "display this help text") @@ -236,8 +230,8 @@ func main() { // Connect client and get chain info. log.Printf("Get chain info from api at: %s", conf.Api) - eosClient = eos.New(conf.Api) - chainInfo, err = eosClient.GetInfo(eosClientCtx) + eosClient := eos.New(conf.Api) + chainInfo, err = eosClient.GetInfo(context.Background()) if err != nil { log.WithError(err).Fatal("Failed to get info") return