Register spec types in client

Allow types to be registred multiple times instead of panic.

Fixes #1235

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-07-24 13:30:37 -04:00
parent 9b53b8b68d
commit 228f7d452c
2 changed files with 11 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ func Register(v interface{}, args ...string) {
mu.Lock()
defer mu.Unlock()
if _, ok := registry[t]; ok {
panic(errdefs.ErrAlreadyExists)
return
}
registry[t] = path.Join(append([]string{Prefix}, args...)...)
}