Skip to content

Commit

Permalink
Fix bug with custom registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchoi-viant committed Sep 18, 2023
1 parent 498222b commit 6f0ca61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/client/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6f0ca61

Please sign in to comment.