-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It would be more clear to have a kernel to init all subsystem then isn't necessary to call in each subsystem package a hidden register function
Prototype
Caller:
package main
func main() {
kernel := kernel.Init()
}Init Kernel:
package kernel
func Init() {
k := new(kernel)
k.RegisterSubsystem(new(subsystem.Memory))
// soon on ...
}Kernel:
package kernel
type Kernel struct {
subsystems map[string]subsystem
}
func (k *kernel) RegisterSubsystem(s subsystem) {
k.subsystems[s.Name()] = s
}What do you think?
Metadata
Metadata
Assignees
Labels
No labels