-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
107 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ func AddListMembers(domain, apiKey string) error { | |
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) | ||
defer cancel() | ||
|
||
return mg.CreateMemberList(ctx, nil, "[email protected]", []interface{}{ | ||
return mg.CreateMemberList(ctx, nil, "[email protected]", []any{ | ||
mailgun.Member{ | ||
Address: "[email protected]", | ||
Name: "Alice's debugging account", | ||
|
@@ -86,7 +86,7 @@ func AddListMembers(domain, apiKey string) error { | |
Address: "[email protected]", | ||
// Charlette is a ham radio packet BBS user. | ||
// We attach her packet BBS e-mail address as an arbitrary var here. | ||
Vars: map[string]interface{}{ | ||
Vars: map[string]any{ | ||
"packet-email": "KW9ABC @ BOGUS-4.#NCA.CA.USA.NOAM", | ||
}, | ||
}, | ||
|
@@ -853,12 +853,12 @@ func SendTemplateMessage(domain, apiKey string) (string, error) { | |
// Set template to be applied to this message. | ||
m.SetTemplate("my-template") | ||
|
||
m.AddRecipientAndVariables("[email protected]", map[string]interface{}{ | ||
m.AddRecipientAndVariables("[email protected]", map[string]any{ | ||
"first": "bob", | ||
"id": 1, | ||
}) | ||
|
||
m.AddRecipientAndVariables("[email protected]", map[string]interface{}{ | ||
m.AddRecipientAndVariables("[email protected]", map[string]any{ | ||
"first": "alice", | ||
"id": 2, | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ func TestMailingListMembers(t *testing.T) { | |
require.NoError(t, mg.DeleteMember(ctx, "[email protected]", address)) | ||
assert.Equal(t, startCount, countMembers()) | ||
|
||
err = mg.CreateMemberList(ctx, nil, address, []interface{}{ | ||
err = mg.CreateMemberList(ctx, nil, address, []any{ | ||
mailgun.Member{ | ||
Address: "[email protected]", | ||
Name: "Joe's debugging account", | ||
|
@@ -80,7 +80,7 @@ func TestMailingListMembers(t *testing.T) { | |
}, | ||
mailgun.Member{ | ||
Address: "[email protected]", | ||
Vars: map[string]interface{}{ | ||
Vars: map[string]any{ | ||
"packet-email": "KW9ABC @ BOGBBS-4.#NCA.CA.USA.NOAM", | ||
}, | ||
}, | ||
|
@@ -164,9 +164,9 @@ func TestListMailingListRegression(t *testing.T) { | |
require.NoError(t, err) | ||
|
||
for i := 0; i < 200; i++ { | ||
var vars map[string]interface{} | ||
var vars map[string]any | ||
if i == 5 { | ||
vars = map[string]interface{}{"has": "vars"} | ||
vars = map[string]any{"has": "vars"} | ||
} | ||
|
||
err := mg.CreateMember(ctx, false, address, mailgun.Member{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -281,7 +281,7 @@ func TestSendMGBatchRecipientVariables(t *testing.T) { | |
|
||
ctx := context.Background() | ||
m := mailgun.NewMessage(fromUser, exampleSubject, templateText) | ||
err = m.AddRecipientAndVariables(toUser, map[string]interface{}{ | ||
err = m.AddRecipientAndVariables(toUser, map[string]any{ | ||
"name": "Joe Cool Example", | ||
"table": 42, | ||
}) | ||
|
@@ -374,7 +374,7 @@ func TestSendMGMessageVariables(t *testing.T) { | |
) | ||
var ( | ||
exampleMapVarVal = map[string]string{"test": "123"} | ||
exampleTemplateVariable = map[string]interface{}{ | ||
exampleTemplateVariable = map[string]any{ | ||
"key": map[string]string{ | ||
"nested": "yes", | ||
"status": "test", | ||
|
@@ -437,11 +437,11 @@ func TestAddRecipientAndVariablesError(t *testing.T) { | |
|
||
for i := 0; i < 1000; i++ { | ||
recipient := fmt.Sprintf("recipient_%[email protected]", i) | ||
err = m.AddRecipientAndVariables(recipient, map[string]interface{}{"id": i}) | ||
err = m.AddRecipientAndVariables(recipient, map[string]any{"id": i}) | ||
require.NoError(t, err) | ||
} | ||
|
||
err = m.AddRecipientAndVariables("[email protected]", map[string]interface{}{"id": 1001}) | ||
err = m.AddRecipientAndVariables("[email protected]", map[string]any{"id": 1001}) | ||
require.EqualError(t, err, "recipient limit exceeded (max 1000)") | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.