Implementation has unit name

This commit is contained in:
2015-02-11 19:33:46 +07:00
parent 9e472cc9a3
commit 7f552e5c8a
4 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ func NewBank(config string) *Bank {
func (b *Bank) Unit(name string) Caller {
if u, ok := b.units[name]; ok {
// Check for unit implementation and create a unit if there is none
if imp := impl.New(u.Impl); imp != nil {
if imp := impl.New(u.Name, u.Impl); imp != nil {
return imp
} else {
return u