Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc committed Jan 2, 2025
1 parent 3366c74 commit a977545
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 0 additions & 5 deletions analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package mailgun

import (
"context"
"strings"

"github.com/mailgun/errors"
)
Expand Down Expand Up @@ -35,10 +34,6 @@ type MetricsPagination struct {
//
// https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/
func (mg *MailgunImpl) ListMetrics(opts MetricsOptions) (*MetricsIterator, error) {
if !strings.HasSuffix(mg.APIBase(), "/v1") {
return nil, errors.New("only v1 API is supported")
}

if opts.Pagination.Limit == 0 {
opts.Pagination.Limit = 10
}
Expand Down
3 changes: 2 additions & 1 deletion attachments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func createAttachment(t *testing.T) string {

func TestMultipleAttachments(t *testing.T) {
mg := mailgun.NewMailgun(testKey)
mg.SetAPIBase(server.URL3())
err := mg.SetAPIBase(server.URL3())
require.NoError(t, err)

var ctx = context.Background()

Expand Down
6 changes: 4 additions & 2 deletions ips_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ func TestMain(m *testing.M) {

func TestListIPS(t *testing.T) {
mg := mailgun.NewMailgun(testKey)
mg.SetAPIBase(server.URL3())
err := mg.SetAPIBase(server.URL3())
require.NoError(t, err)

ctx := context.Background()
list, err := mg.ListIPS(ctx, false)
Expand All @@ -38,7 +39,8 @@ func TestListIPS(t *testing.T) {

func TestDomainIPS(t *testing.T) {
mg := mailgun.NewMailgun(testKey)
mg.SetAPIBase(server.URL3())
err := mg.SetAPIBase(server.URL3())
require.NoError(t, err)

ctx := context.Background()
err := mg.AddDomainIP(ctx, testDomain, "192.172.1.1")

Check failure on line 46 in ips_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

no new variables on left side of := (typecheck)

Check failure on line 46 in ips_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

no new variables on left side of := (typecheck)
Expand Down

0 comments on commit a977545

Please sign in to comment.