From 82fdc94b93132842d593765fadf11172b86f7a77 Mon Sep 17 00:00:00 2001 From: Dmitry Redkin Date: Fri, 11 Nov 2022 12:30:59 +0500 Subject: [PATCH] refactor: Rename files Rename `init.go` files to `sender.go`, because files no more contain Init method. --- senders/discord/{init.go => sender.go} | 0 senders/discord/{init_test.go => sender_test.go} | 0 senders/opsgenie/{init.go => sender.go} | 0 senders/opsgenie/{init_test.go => sender_test.go} | 0 senders/pagerduty/{init.go => sender.go} | 0 senders/pagerduty/{init_test.go => sender_test.go} | 0 senders/telegram/{init.go => sender.go} | 0 senders/telegram/{init_test.go => sender_test.go} | 7 ++++--- senders/victorops/{init.go => sender.go} | 0 senders/victorops/{init_test.go => sender_test.go} | 0 10 files changed, 4 insertions(+), 3 deletions(-) rename senders/discord/{init.go => sender.go} (100%) rename senders/discord/{init_test.go => sender_test.go} (100%) rename senders/opsgenie/{init.go => sender.go} (100%) rename senders/opsgenie/{init_test.go => sender_test.go} (100%) rename senders/pagerduty/{init.go => sender.go} (100%) rename senders/pagerduty/{init_test.go => sender_test.go} (100%) rename senders/telegram/{init.go => sender.go} (100%) rename senders/telegram/{init_test.go => sender_test.go} (75%) rename senders/victorops/{init.go => sender.go} (100%) rename senders/victorops/{init_test.go => sender_test.go} (100%) diff --git a/senders/discord/init.go b/senders/discord/sender.go similarity index 100% rename from senders/discord/init.go rename to senders/discord/sender.go diff --git a/senders/discord/init_test.go b/senders/discord/sender_test.go similarity index 100% rename from senders/discord/init_test.go rename to senders/discord/sender_test.go diff --git a/senders/opsgenie/init.go b/senders/opsgenie/sender.go similarity index 100% rename from senders/opsgenie/init.go rename to senders/opsgenie/sender.go diff --git a/senders/opsgenie/init_test.go b/senders/opsgenie/sender_test.go similarity index 100% rename from senders/opsgenie/init_test.go rename to senders/opsgenie/sender_test.go diff --git a/senders/pagerduty/init.go b/senders/pagerduty/sender.go similarity index 100% rename from senders/pagerduty/init.go rename to senders/pagerduty/sender.go diff --git a/senders/pagerduty/init_test.go b/senders/pagerduty/sender_test.go similarity index 100% rename from senders/pagerduty/init_test.go rename to senders/pagerduty/sender_test.go diff --git a/senders/telegram/init.go b/senders/telegram/sender.go similarity index 100% rename from senders/telegram/init.go rename to senders/telegram/sender.go diff --git a/senders/telegram/init_test.go b/senders/telegram/sender_test.go similarity index 75% rename from senders/telegram/init_test.go rename to senders/telegram/sender_test.go index ae645ce62..fb1241edd 100644 --- a/senders/telegram/init_test.go +++ b/senders/telegram/sender_test.go @@ -1,4 +1,4 @@ -package telegram +package telegram_test import ( "fmt" @@ -6,6 +6,7 @@ import ( "time" logging "github.com/moira-alert/moira/logging/zerolog_adapter" + "github.com/moira-alert/moira/senders/telegram" . "github.com/smartystreets/goconvey/convey" ) @@ -14,7 +15,7 @@ func TestNewSender(t *testing.T) { location, _ := time.LoadLocation("UTC") Convey("Init tests", t, func() { Convey("Empty map", func() { - sender, err := NewSender(map[string]string{}, logger, nil, nil) + sender, err := telegram.NewSender(map[string]string{}, logger, nil, nil) So(err, ShouldResemble, fmt.Errorf("can not read telegram api_token from config")) So(sender, ShouldBeNil) }) @@ -24,7 +25,7 @@ func TestNewSender(t *testing.T) { "api_token": "123", "front_uri": "http://moira.uri", } - sender, err := NewSender(senderSettings, logger, location, nil) + sender, err := telegram.NewSender(senderSettings, logger, location, nil) So(sender, ShouldBeNil) So(err, ShouldNotBeNil) }) diff --git a/senders/victorops/init.go b/senders/victorops/sender.go similarity index 100% rename from senders/victorops/init.go rename to senders/victorops/sender.go diff --git a/senders/victorops/init_test.go b/senders/victorops/sender_test.go similarity index 100% rename from senders/victorops/init_test.go rename to senders/victorops/sender_test.go