From 26c73c48e57fd506c0a3afccf4f5e9f1abaa0770 Mon Sep 17 00:00:00 2001 From: Arvid Bjurklint Date: Fri, 9 Aug 2024 14:11:28 +0200 Subject: [PATCH] Fix null pointer reference (epic) --- main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.go b/main.go index c497886..b5757bc 100644 --- a/main.go +++ b/main.go @@ -73,7 +73,6 @@ func main() { } fmt.Println(string(output)) case "interactive": - cachedSecrets = make(map[string]Secret) slog.SetLogLoggerLevel(slog.LevelError) screen, err := tcell.NewScreen() if err != nil { @@ -273,7 +272,7 @@ type Secret struct { } `json:"data"` } -var cachedSecrets map[string]Secret +var cachedSecrets = make(map[string]Secret) func (v VaultClient) getSecret(name string) (Secret, error) { if secret, found := cachedSecrets[name]; found {