1. binet
  2. go-root

Commits

Sebastien Binet  committed a921339

reshuffling code around: core -> key, directory

  • Participants
  • Parent commits 7b35c88
  • Branches default

Comments (0)

Files changed (2)

File pkg/groot/directory.go

View file
 	"fmt"
 	"io"
 	"os"
+	"reflect"
 	"time"
 )
 
 	return nkeys, nil
 }
 
+func init() {
+
+	make_dir := func() reflect.Value {
+		o := &Directory{file: nil, keys: make([]Key, 0)}
+		return reflect.ValueOf(o)
+	}
+
+	Factory.db["TDirectory"] = make_dir
+	Factory.db["*groot.Directory"] = make_dir
+}
+
+
 // EOF

File pkg/groot/factory.go

View file
 }
 
 // the registry of all factory functions, by class name
-var Factory factory
-
-func init() {
-	Factory = factory{
-		db: make(map[string]FactoryFct),
-	}
-
-	Factory.db["TDirectory"] = func() reflect.Value {
-		o := &Directory{file: nil, keys: make([]Key, 0)}
-		return reflect.ValueOf(o)
-	}
+var Factory factory = factory{
+	db: make(map[string]FactoryFct),
 }
 
 // EOF