From c6227acba169f247bfa60c9d2493ff0a7d439f08 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Wed, 9 Oct 2024 16:46:22 +0300 Subject: [PATCH] use build tag to define account service --- internal/testutil/tag_offline.go | 13 +++++++++++++ internal/testutil/tag_online.go | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 internal/testutil/tag_offline.go create mode 100644 internal/testutil/tag_online.go diff --git a/internal/testutil/tag_offline.go b/internal/testutil/tag_offline.go new file mode 100644 index 0000000..fc57c90 --- /dev/null +++ b/internal/testutil/tag_offline.go @@ -0,0 +1,13 @@ +// +build !online + +package testutil + +import ( + "git.grassecon.net/urdt/ussd/internal/handlers/server" +) + +var AccountService server.AccountServiceInterface + +func init() { + AccountService = &server.MockAccountService{} +} \ No newline at end of file diff --git a/internal/testutil/tag_online.go b/internal/testutil/tag_online.go new file mode 100644 index 0000000..cc3f00c --- /dev/null +++ b/internal/testutil/tag_online.go @@ -0,0 +1,11 @@ +// +build online + +package testutil + +import "git.grassecon.net/urdt/ussd/internal/handlers/server" + +var AccountService server.AccountServiceInterface + +func init() { + AccountService = &server.AccountService{} +}