From 70e234aa7c5d3f4d86d8496e7a0198cf0d7af63b Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Sat, 12 Oct 2024 13:32:34 +0300 Subject: [PATCH] pass account service as a global var --- internal/testutil/tag_offline.go | 9 ++++----- internal/testutil/tag_online.go | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/internal/testutil/tag_offline.go b/internal/testutil/tag_offline.go index fc57c90..2335a5e 100644 --- a/internal/testutil/tag_offline.go +++ b/internal/testutil/tag_offline.go @@ -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{} -} \ No newline at end of file +var ( + AccountService server.AccountServiceInterface = &server.TestAccountService{} +) diff --git a/internal/testutil/tag_online.go b/internal/testutil/tag_online.go index cc3f00c..5a7e928 100644 --- a/internal/testutil/tag_online.go +++ b/internal/testutil/tag_online.go @@ -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 +)