Skip to content

Commit

Permalink
Fixed linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Feb 28, 2024
1 parent 56e9895 commit d2adf14
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 75 deletions.
12 changes: 6 additions & 6 deletions bounce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand All @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand All @@ -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))
})

Expand Down
4 changes: 2 additions & 2 deletions email_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
10 changes: 5 additions & 5 deletions message_streams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand All @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
8 changes: 4 additions & 4 deletions messages_inbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand All @@ -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))
})

Expand All @@ -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))
})

Expand Down
10 changes: 5 additions & 5 deletions messages_outbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand All @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
2 changes: 1 addition & 1 deletion postmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
2 changes: 1 addition & 1 deletion sender_signatures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down
4 changes: 2 additions & 2 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
4 changes: 2 additions & 2 deletions servers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
14 changes: 7 additions & 7 deletions stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
8 changes: 4 additions & 4 deletions suppressions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down Expand Up @@ -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))
})

Expand Down
Loading

0 comments on commit d2adf14

Please sign in to comment.