pass account service as a global var

This commit is contained in:
Carlosokumu 2024-10-12 13:32:34 +03:00
parent 554cecc7f3
commit 70e234aa7c
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953
2 changed files with 8 additions and 10 deletions

View File

@ -1,3 +1,4 @@
//go:build !online
// +build !online
package testutil
@ -6,8 +7,6 @@ import (
"git.grassecon.net/urdt/ussd/internal/handlers/server"
)
var AccountService server.AccountServiceInterface
func init() {
AccountService = &server.MockAccountService{}
}
var (
AccountService server.AccountServiceInterface = &server.TestAccountService{}
)

View File

@ -1,11 +1,10 @@
//go:build online
// +build online
package testutil
import "git.grassecon.net/urdt/ussd/internal/handlers/server"
var AccountService server.AccountServiceInterface
func init() {
AccountService = &server.AccountService{}
}
var (
AccountService server.AccountServiceInterface
)