From 7b29b9d33d2f2967a3a324c0d801c768a74c1f77 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Thu, 8 Nov 2018 10:15:27 +0300 Subject: [PATCH] remove currency constants --- v1/client_test.go | 16 ++++++++-------- v1/request.go | 2 +- v1/types.go | 13 ------------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/v1/client_test.go b/v1/client_test.go index c3510d9..83e2ded 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -11,7 +11,7 @@ import ( var ( mgURL = os.Getenv("MG_URL") mgToken = os.Getenv("MG_TOKEN") - channelId, _ = strconv.ParseUint(os.Getenv("MG_CHANNEL"), 10, 64) + channelID, _ = strconv.ParseUint(os.Getenv("MG_CHANNEL"), 10, 64) ext = strconv.FormatInt(time.Now().UTC().UnixNano(), 10) ) @@ -34,7 +34,7 @@ func TestMgClient_TransportChannels(t *testing.T) { func TestMgClient_ActivateTransportChannel(t *testing.T) { c := client() ch := Channel{ - ID: channelId, + ID: channelID, Type: "telegram", Name: "@my_shopping_bot", Settings: ChannelSettings{ @@ -121,7 +121,7 @@ func TestMgClient_ActivateNewTransportChannel(t *testing.T) { func TestMgClient_UpdateTransportChannel(t *testing.T) { c := client() ch := Channel{ - ID: channelId, + ID: channelID, Name: "@my_shopping_bot_2", Settings: ChannelSettings{ SpamAllowed: false, @@ -170,7 +170,7 @@ func TestMgClient_Messages(t *testing.T) { Nickname: "octopus", Firstname: "Joe", }, - Channel: channelId, + Channel: channelID, ExternalChatID: "24798237492374", } @@ -196,7 +196,7 @@ func TestMgClient_UpdateMessages(t *testing.T) { ExternalID: ext, Text: "hello hello!", }, - channelId, + channelID, } dataU, status, err := c.UpdateMessages(sndU) @@ -220,7 +220,7 @@ func TestMgClient_MarkMessageReadAndDelete(t *testing.T) { MarkMessageReadRequestMessage{ ExternalID: ext, }, - channelId, + channelID, } _, status, err := c.MarkMessageRead(snd) @@ -235,7 +235,7 @@ func TestMgClient_MarkMessageReadAndDelete(t *testing.T) { Message{ ExternalID: ext, }, - channelId, + channelID, } data, status, err := c.DeleteMessage(sndD) @@ -249,7 +249,7 @@ func TestMgClient_MarkMessageReadAndDelete(t *testing.T) { func TestMgClient_DeactivateTransportChannel(t *testing.T) { c := client() - deleteData, status, err := c.DeactivateTransportChannel(channelId) + deleteData, status, err := c.DeactivateTransportChannel(channelID) if err != nil { t.Errorf("%d %v", status, err) diff --git a/v1/request.go b/v1/request.go index 9bf8c4d..b7d65fc 100644 --- a/v1/request.go +++ b/v1/request.go @@ -70,7 +70,7 @@ func makeRequest(reqType, url string, buf *bytes.Buffer, c *MgClient) ([]byte, i } if resp.StatusCode >= http.StatusInternalServerError { - err = fmt.Errorf("HTTP request error. Status code: %d.\n", resp.StatusCode) + err = fmt.Errorf("http request error. status code: %d", resp.StatusCode) return res, resp.StatusCode, err } diff --git a/v1/types.go b/v1/types.go index c909d98..3fa5b72 100644 --- a/v1/types.go +++ b/v1/types.go @@ -39,19 +39,6 @@ const ( MsgOrderStatusCodeComplete = "complete" // MsgOrderStatusCodeCancel order status group cancel MsgOrderStatusCodeCancel = "cancel" - - // MsgCurrencyRub currency code for russian ruble - MsgCurrencyRub = "rub" - // MsgCurrencyUah currency code for ukrainian hryvnia - MsgCurrencyUah = "uah" - // MsgCurrencyByr currency code for belorussian ruble - MsgCurrencyByr = "byr" - // MsgCurrencyKzt currency code for kazakh tenge - MsgCurrencyKzt = "kzt" - // MsgCurrencyUsd currency code for us dollar - MsgCurrencyUsd = "usd" - // MsgCurrencyEur currency code for euro - MsgCurrencyEur = "eur" ) // MgClient type