调整SetOptions的方式
This commit is contained in:
@@ -15,13 +15,13 @@ func TestSmtpEnhanced(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
// 测试空配置
|
||||
_, err := smtp.SetOption(ctx)
|
||||
err := smtp.SetOption(ctx)
|
||||
if err == nil {
|
||||
t.Error("Expected error for empty config")
|
||||
}
|
||||
|
||||
// 测试不完整配置
|
||||
_, err = smtp.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
err = smtp.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
opt.Smtp = &interfaces.EmailConfigDataSmtp{
|
||||
Host: "smtp.example.com",
|
||||
// 缺少用户名和密码
|
||||
@@ -32,7 +32,7 @@ func TestSmtpEnhanced(t *testing.T) {
|
||||
}
|
||||
|
||||
// 测试完整配置
|
||||
_, err = smtp.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
err = smtp.SetOption(ctx, func(opt *interfaces.Options) {
|
||||
opt.Smtp = &interfaces.EmailConfigDataSmtp{
|
||||
Host: "smtp.example.com",
|
||||
Port: "587",
|
||||
|
||||
Reference in New Issue
Block a user