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