move init functions to top of file

This commit is contained in:
Joel Wetzell
2026-05-22 17:45:03 -05:00
parent fb3c775765
commit 4323a21015
67 changed files with 1706 additions and 1706 deletions
+10 -10
View File
@@ -12,6 +12,16 @@ import (
"github.com/jwetzell/showbridge-go/internal/config"
)
func init() {
RegisterModule(ModuleRegistration{
Type: "psn.client",
Title: "PosiStageNet Client",
New: func(config config.ModuleConfig) (common.Module, error) {
return &PSNClient{config: config, decoder: psn.NewDecoder(), logger: CreateLogger(config)}, nil
},
})
}
type PSNClient struct {
config config.ModuleConfig
conn *net.UDPConn
@@ -23,16 +33,6 @@ type PSNClient struct {
connMu sync.Mutex
}
func init() {
RegisterModule(ModuleRegistration{
Type: "psn.client",
Title: "PosiStageNet Client",
New: func(config config.ModuleConfig) (common.Module, error) {
return &PSNClient{config: config, decoder: psn.NewDecoder(), logger: CreateLogger(config)}, nil
},
})
}
func (pc *PSNClient) Id() string {
return pc.config.Id
}