fix: add init to create an empty router

This commit is contained in:
Derrick Hammer 2024-01-28 04:44:16 -05:00
parent 6c31a0a79f
commit 610d5fe268
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,10 @@ type APIEntry struct {
var apiRegistry []APIEntry var apiRegistry []APIEntry
var router router2.ProtocolRouter var router router2.ProtocolRouter
func init() {
router = make(router2.ProtocolRouter)
}
func Register(entry APIEntry) { func Register(entry APIEntry) {
apiRegistry = append(apiRegistry, entry) apiRegistry = append(apiRegistry, entry)
} }