imapclient: clean up function signature of New, allowing for future options too

This commit is contained in:
Mechiel Lukkien
2025-04-11 21:04:13 +02:00
parent af3e9351bc
commit 2c1283f032
6 changed files with 53 additions and 29 deletions

View File

@ -9,6 +9,7 @@ import (
"crypto/x509"
"flag"
"fmt"
"log/slog"
"math/big"
"net"
"os"
@ -524,7 +525,11 @@ func TestCtl(t *testing.T) {
testctl(func(xctl *ctl) {
a, b := net.Pipe()
go func() {
client, err := imapclient.New(mox.Cid(), a, true)
opts := imapclient.Opts{
Logger: slog.Default().With("cid", mox.Cid()),
Error: func(err error) { panic(err) },
}
client, err := imapclient.New(a, &opts)
tcheck(t, err, "new imapclient")
client.Select("inbox")
client.Logout()