From d2adf141b97608057e7ee1a1a6e8c8a1dd4ef5db Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Wed, 28 Feb 2024 09:58:49 -0500 Subject: [PATCH] Fixed linter issues --- bounce_test.go | 12 ++++----- email_test.go | 4 +-- message_streams_test.go | 10 +++---- messages_inbound_test.go | 8 +++--- messages_outbound_test.go | 10 +++---- postmark_test.go | 2 +- sender_signatures_test.go | 2 +- server_test.go | 4 +-- servers_test.go | 4 +-- stats_test.go | 14 +++++----- suppressions_test.go | 8 +++--- templates_test.go | 16 +++++------ webhooks_test.go | 56 +++++++++++++++++++-------------------- 13 files changed, 75 insertions(+), 75 deletions(-) diff --git a/bounce_test.go b/bounce_test.go index 7ebffc2..c3eb96f 100644 --- a/bounce_test.go +++ b/bounce_test.go @@ -48,7 +48,7 @@ func TestGetDeliveryStats(t *testing.T) { } ]}` - tMux.HandleFunc(pat.Get("/deliverystats"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/deliverystats"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -101,7 +101,7 @@ func TestGetBounces(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/bounces"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/bounces"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -136,7 +136,7 @@ func TestGetBounce(t *testing.T) { "Content": "Return-Path: <>\r\nReceived: …" }` - tMux.HandleFunc(pat.Get("/bounces/692560173"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/bounces/692560173"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -155,7 +155,7 @@ func TestGetBounceDump(t *testing.T) { "Body": "..." }` - tMux.HandleFunc(pat.Get("/bounces/692560173/dump"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/bounces/692560173/dump"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -191,7 +191,7 @@ func TestActivateBounce(t *testing.T) { } }` - tMux.HandleFunc(pat.Put("/bounces/692560173/activate"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Put("/bounces/692560173/activate"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -215,7 +215,7 @@ func TestGetBouncedTags(t *testing.T) { "tag3"] ` - tMux.HandleFunc(pat.Get("/bounces/tags"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/bounces/tags"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/email_test.go b/email_test.go index 8d58242..da07976 100644 --- a/email_test.go +++ b/email_test.go @@ -48,7 +48,7 @@ func TestSendEmail(t *testing.T) { "Message": "OK" }` - tMux.HandleFunc(pat.Post("/email"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/email"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -96,7 +96,7 @@ func TestSendEmailBatch(t *testing.T) { } ]` - tMux.HandleFunc(pat.Post("/email/batch"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/email/batch"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/message_streams_test.go b/message_streams_test.go index a81f817..d2de28b 100644 --- a/message_streams_test.go +++ b/message_streams_test.go @@ -104,7 +104,7 @@ func TestListMessageStreams(t *testing.T) { func TestGetUnknownMessageStream(t *testing.T) { responseJSON := `{"ErrorCode":1226,"Message":"The message stream for the provided 'ID' was not found."}` - tMux.HandleFunc(pat.Get("/message-streams/unknown"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/message-streams/unknown"), func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusUnprocessableEntity) _, _ = w.Write([]byte(responseJSON)) }) @@ -139,7 +139,7 @@ func TestGetMessageStream(t *testing.T) { } }` - tMux.HandleFunc(pat.Get("/message-streams/broadcasts"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/message-streams/broadcasts"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -246,7 +246,7 @@ func TestCreateMessageStream(t *testing.T) { }, } - tMux.HandleFunc(pat.Post("/message-streams"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/message-streams"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -273,7 +273,7 @@ func TestArchiveMessageStream(t *testing.T) { "ExpectedPurgeDate": "2020-08-30T12:30:00.00-04:00" }` - tMux.HandleFunc(pat.Post("/message-streams/transactional-dev/archive"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/message-streams/transactional-dev/archive"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -308,7 +308,7 @@ func TestUnarchiveMessageStream(t *testing.T) { } }` - tMux.HandleFunc(pat.Post("/message-streams/transactional-dev/unarchive"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/message-streams/transactional-dev/unarchive"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/messages_inbound_test.go b/messages_inbound_test.go index 62cd750..92d7e6c 100644 --- a/messages_inbound_test.go +++ b/messages_inbound_test.go @@ -85,7 +85,7 @@ func TestGetInboundMessage(t *testing.T) { "Status": "Blocked" }` - tMux.HandleFunc(pat.Get("/messages/inbound/cc5727a0-ea30-4e79-baea-aa43c9628ac4/details"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/inbound/cc5727a0-ea30-4e79-baea-aa43c9628ac4/details"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -138,7 +138,7 @@ func TestGetInboundMessages(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/messages/inbound"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/inbound"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -163,7 +163,7 @@ func TestBypassInboundMessage(t *testing.T) { "Message": "Successfully bypassed message: 792a3e9d-0078-40df-a6b0-fc78f87bf277." }` - tMux.HandleFunc(pat.Put("/messages/inbound/792a3e9d-0078-40df-a6b0-fc78f87bf277/bypass"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Put("/messages/inbound/792a3e9d-0078-40df-a6b0-fc78f87bf277/bypass"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -190,7 +190,7 @@ func TestRetryInboundMessage(t *testing.T) { "Message": "Successfully rescheduled failed message: 041e3d29-737d-491e-9a13-a94d3rjkjka13." }` - tMux.HandleFunc(pat.Put("/messages/inbound/041e3d29-737d-491e-9a13-a94d3rjkjka13/retry"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Put("/messages/inbound/041e3d29-737d-491e-9a13-a94d3rjkjka13/retry"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/messages_outbound_test.go b/messages_outbound_test.go index c0a5f32..948db50 100644 --- a/messages_outbound_test.go +++ b/messages_outbound_test.go @@ -63,7 +63,7 @@ func TestGetOutboundMessage(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/messages/outbound/07311c54-0687-4ab9-b034-b54b5bad88ba/details"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/outbound/07311c54-0687-4ab9-b034-b54b5bad88ba/details"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -82,7 +82,7 @@ func TestGetOutboundMessageDump(t *testing.T) { responseJSON := fmt.Sprintf(`{"Body": "%s"}`, dump) - tMux.HandleFunc(pat.Get("/messages/outbound/07311c54-0687-4ab9-b034-b54b5bad88ba/dump"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/outbound/07311c54-0687-4ab9-b034-b54b5bad88ba/dump"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -119,7 +119,7 @@ func TestGetOutboundMessages(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/messages/outbound"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/outbound"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -176,7 +176,7 @@ func TestGetOutboundMessagesOpens(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/messages/outbound/opens"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/outbound/opens"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -228,7 +228,7 @@ func TestGetOutboundMessageOpens(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/messages/outbound/opens/927e56d4-dc66-4070-bbf0-1db76c2ae14b"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/messages/outbound/opens/927e56d4-dc66-4070-bbf0-1db76c2ae14b"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/postmark_test.go b/postmark_test.go index 56360a6..d431707 100644 --- a/postmark_test.go +++ b/postmark_test.go @@ -18,7 +18,7 @@ func init() { tServer = httptest.NewServer(tMux) transport := &http.Transport{ - Proxy: func(req *http.Request) (*url.URL, error) { + Proxy: func(_ *http.Request) (*url.URL, error) { // Reroute... return url.Parse(tServer.URL) }, diff --git a/sender_signatures_test.go b/sender_signatures_test.go index 071fdf1..c3ca239 100644 --- a/sender_signatures_test.go +++ b/sender_signatures_test.go @@ -31,7 +31,7 @@ func TestGetSenderSignatures(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/senders"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/senders"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/server_test.go b/server_test.go index a36f606..ceb7cdb 100644 --- a/server_test.go +++ b/server_test.go @@ -34,7 +34,7 @@ func TestGetCurrentServer(t *testing.T) { "InboundSpamThreshold": 0 }` - tMux.HandleFunc(pat.Get("/server"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/server"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -73,7 +73,7 @@ func TestEditCurrentServer(t *testing.T) { "InboundHash": "yourhash", "InboundSpamThreshold": 10 }` - tMux.HandleFunc(pat.Put("/server"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Put("/server"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/servers_test.go b/servers_test.go index 8631bfa..fa32e83 100644 --- a/servers_test.go +++ b/servers_test.go @@ -30,7 +30,7 @@ func TestGetServer(t *testing.T) { "InboundSpamThreshold": 0 }` - tMux.HandleFunc(pat.Get("/servers/:serverID"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/servers/:serverID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -66,7 +66,7 @@ func TestEditServer(t *testing.T) { "InboundSpamThreshold": 10 }` - tMux.HandleFunc(pat.Put("/servers/:serverID"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Put("/servers/:serverID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/stats_test.go b/stats_test.go index a9d740b..52497c9 100644 --- a/stats_test.go +++ b/stats_test.go @@ -24,7 +24,7 @@ func TestGetOutboundStats(t *testing.T) { "WithReadTimeRecorded": 10 }` - tMux.HandleFunc(pat.Get("/stats/outbound"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -64,7 +64,7 @@ func TestGetSentCounts(t *testing.T) { "Sent": 615 }` - tMux.HandleFunc(pat.Get("/stats/outbound/sends"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound/sends"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -113,7 +113,7 @@ func TestGetBounceCounts(t *testing.T) { "Transient": 16 }` - tMux.HandleFunc(pat.Get("/stats/outbound/bounces"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound/bounces"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -153,7 +153,7 @@ func TestGetSpamCounts(t *testing.T) { "SpamComplaint": 10 }` - tMux.HandleFunc(pat.Get("/stats/outbound/spam"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound/spam"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -201,7 +201,7 @@ func TestGetTrackedCounts(t *testing.T) { "Tracked": 111 }` - tMux.HandleFunc(pat.Get("/stats/outbound/tracked"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound/tracked"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -255,7 +255,7 @@ func TestGetOpenCounts(t *testing.T) { "Unique": 26 }` - tMux.HandleFunc(pat.Get("/stats/outbound/opens"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound/opens"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -301,7 +301,7 @@ func TestGetPlatformCounts(t *testing.T) { "WebMail": 2 }` - tMux.HandleFunc(pat.Get("/stats/outbound/platform"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/stats/outbound/platform"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/suppressions_test.go b/suppressions_test.go index 584c343..91a55d4 100644 --- a/suppressions_test.go +++ b/suppressions_test.go @@ -32,7 +32,7 @@ func TestGetSuppressions(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/message-streams/:StreamID/suppressions/dump"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/message-streams/:StreamID/suppressions/dump"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -60,7 +60,7 @@ func TestGetSuppressions(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/message-streams/:StreamID/suppressions/dump"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/message-streams/:StreamID/suppressions/dump"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -105,7 +105,7 @@ func TestCreateSuppressions(t *testing.T) { ] }` - tMux.HandleFunc(pat.Post("/message-streams/:StreamID/suppressions"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/message-streams/:StreamID/suppressions"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -138,7 +138,7 @@ func TestDeleteSuppressions(t *testing.T) { ] }` - tMux.HandleFunc(pat.Post("/message-streams/:StreamID/suppressions/delete"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/message-streams/:StreamID/suppressions/delete"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/templates_test.go b/templates_test.go index c0f541d..bfa2949 100644 --- a/templates_test.go +++ b/templates_test.go @@ -19,7 +19,7 @@ func TestGetTemplate(t *testing.T) { "Active": false }` - tMux.HandleFunc(pat.Get("/templates/:templateID"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/templates/:templateID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -50,7 +50,7 @@ func TestGetTemplates(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/templates"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Get("/templates"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -75,7 +75,7 @@ func TestCreateTemplate(t *testing.T) { "Active": true }` - tMux.HandleFunc(pat.Post("/templates"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/templates"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -101,7 +101,7 @@ func TestEditTemplate(t *testing.T) { "Active": true }` - tMux.HandleFunc(pat.Put("/templates/:templateID"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Put("/templates/:templateID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -126,7 +126,7 @@ func TestDeleteTemplate(t *testing.T) { "Message": "Template 1234 removed." }` - tMux.HandleFunc(pat.Delete("/templates/:templateID"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Delete("/templates/:templateID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -186,7 +186,7 @@ func TestValidateTemplate(t *testing.T) { } }` - tMux.HandleFunc(pat.Post("/templates/validate"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/templates/validate"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -254,7 +254,7 @@ func TestSendTemplatedEmail(t *testing.T) { "Message": "OK" }` - tMux.HandleFunc(pat.Post("/email/withTemplate"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/email/withTemplate"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -285,7 +285,7 @@ func TestSendTemplatedBatch(t *testing.T) { } ]` - tMux.HandleFunc(pat.Post("/email/batchWithTemplates"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Post("/email/batchWithTemplates"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) diff --git a/webhooks_test.go b/webhooks_test.go index b22f778..0cead5d 100644 --- a/webhooks_test.go +++ b/webhooks_test.go @@ -14,13 +14,13 @@ const ( ) func TestGetWebhooks(t *testing.T) { - responseJSON := `{ + responseJSON := `{ "Webhooks": [ { - "ID": 1234567, + "ID": 1234567, "Url": "http://www.example.com/webhook-test-tracking", "MessageStream": "outbound", - "HttpAuth":{ + "HttpAuth":{ "Username": "user", "Password": "pass" }, @@ -30,22 +30,22 @@ func TestGetWebhooks(t *testing.T) { "Value": "value" } ], - "Triggers": { - "Open":{ + "Triggers": { + "Open":{ "Enabled": true, "PostFirstOpenOnly": false }, - "Click":{ + "Click":{ "Enabled": true }, - "Delivery":{ + "Delivery":{ "Enabled": true }, - "Bounce":{ + "Bounce":{ "Enabled": false, "IncludeContent": false }, - "SpamComplaint":{ + "SpamComplaint":{ "Enabled": false, "IncludeContent": false }, @@ -55,10 +55,10 @@ func TestGetWebhooks(t *testing.T) { } }, { - "ID": 1234568, + "ID": 1234568, "Url": "http://www.example.com/webhook-test-bounce", "MessageStream": "outbound", - "HttpAuth":{ + "HttpAuth":{ "Username": "user", "Password": "pass" }, @@ -68,22 +68,22 @@ func TestGetWebhooks(t *testing.T) { "Value": "value" } ], - "Triggers": { - "Open":{ + "Triggers": { + "Open":{ "Enabled":false, "PostFirstOpenOnly":false }, - "Click":{ + "Click":{ "Enabled": false }, - "Delivery":{ + "Delivery":{ "Enabled": false }, - "Bounce":{ + "Bounce":{ "Enabled" :true, "IncludeContent": false }, - "SpamComplaint":{ + "SpamComplaint":{ "Enabled": false, "IncludeContent": false }, @@ -95,7 +95,7 @@ func TestGetWebhooks(t *testing.T) { ] }` - tMux.HandleFunc(pat.Get("/webhooks"), func(w http.ResponseWriter, r *http.Request) { + tMux.HandleFunc(pat.Get("/webhooks"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -114,10 +114,10 @@ func TestGetWebhooks(t *testing.T) { func TestGetWebhook(t *testing.T) { responseJSON := `{ - "ID": 1234567, + "ID": 1234567, "Url": "http://www.example.com/webhook-test-tracking", "MessageStream": "outbound", - "HttpAuth":{ + "HttpAuth":{ "Username": "user", "Password": "pass" }, @@ -127,22 +127,22 @@ func TestGetWebhook(t *testing.T) { "Value": "value" } ], - "Triggers": { - "Open":{ + "Triggers": { + "Open":{ "Enabled": true, "PostFirstOpenOnly": false }, - "Click":{ + "Click":{ "Enabled": true }, - "Delivery":{ + "Delivery":{ "Enabled": true }, - "Bounce":{ + "Bounce":{ "Enabled": false, "IncludeContent": false }, - "SpamComplaint":{ + "SpamComplaint":{ "Enabled": false, "IncludeContent": false }, @@ -152,7 +152,7 @@ func TestGetWebhook(t *testing.T) { } }` - tMux.HandleFunc(pat.Get("/webhooks/:webhookID"), func(w http.ResponseWriter, r *http.Request) { + tMux.HandleFunc(pat.Get("/webhooks/:webhookID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) }) @@ -323,7 +323,7 @@ func TestDeleteWebhook(t *testing.T) { "Message": "Webhook 1234 removed." }` - tMux.HandleFunc(pat.Delete("/webhooks/:webhookID"), func(w http.ResponseWriter, req *http.Request) { + tMux.HandleFunc(pat.Delete("/webhooks/:webhookID"), func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte(responseJSON)) })