From ed0327babe06a657b2348d2e9d5e5ea824a71fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= Date: Wed, 18 May 2022 17:07:05 -0300 Subject: [PATCH] Very minor refactor for removing the use of init() --- ksql.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ksql.go b/ksql.go index 559d922..f5f53c6 100644 --- a/ksql.go +++ b/ksql.go @@ -14,12 +14,15 @@ import ( "github.com/vingarcia/ksql/ksqltest" ) -var selectQueryCache = map[string]map[reflect.Type]string{} +var selectQueryCache = initializeQueryCache() -func init() { +func initializeQueryCache() map[string]map[reflect.Type]string { + cache := map[string]map[reflect.Type]string{} for dname := range supportedDialects { - selectQueryCache[dname] = map[reflect.Type]string{} + cache[dname] = map[reflect.Type]string{} } + + return cache } // DB represents the ksql client responsible for