From 6f0ca6154039ae4718300c4a87c9d45a89739e46 Mon Sep 17 00:00:00 2001 From: David Choi Date: Mon, 18 Sep 2023 12:55:41 -0700 Subject: [PATCH] Fix bug with custom registry. --- example/client/custom.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example/client/custom.go b/example/client/custom.go index ef72eed..526f03c 100644 --- a/example/client/custom.go +++ b/example/client/custom.go @@ -5,6 +5,10 @@ type customMakerRegistry struct { } func (c *customMakerRegistry) Register(k string, gen func() interface{}) (old func() interface{}, ok bool) { + if c.registry == nil { + c.registry = make(map[string]func() interface{}) + } + old, ok = c.registry[k] c.registry[k] = gen