mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-09-10 23:49:25 +00:00
move init functions to top of file
This commit is contained in:
+9
-9
@@ -14,6 +14,15 @@ import (
|
||||
"github.com/jwetzell/showbridge-go/internal/module"
|
||||
)
|
||||
|
||||
func init() {
|
||||
module.RegisterModule(module.ModuleRegistration{
|
||||
Type: "mock.counter",
|
||||
New: func(config config.ModuleConfig) (common.Module, error) {
|
||||
return &MockCounterModule{config: config, logger: slog.Default()}, nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type MockCounterModule struct {
|
||||
config config.ModuleConfig
|
||||
ctx context.Context
|
||||
@@ -58,15 +67,6 @@ func (mcm *MockCounterModule) Stop() {
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
module.RegisterModule(module.ModuleRegistration{
|
||||
Type: "mock.counter",
|
||||
New: func(config config.ModuleConfig) (common.Module, error) {
|
||||
return &MockCounterModule{config: config, logger: slog.Default()}, nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestNewRouter(t *testing.T) {
|
||||
routerConfig := config.Config{
|
||||
Modules: []config.ModuleConfig{
|
||||
|
||||
Reference in New Issue
Block a user