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

@ -7,6 +7,7 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"log/slog"
"math/big"
"net"
"os"
@ -536,8 +537,11 @@ func startArgsMore(t *testing.T, uidonly, first, immediateTLS bool, serverConfig
serve("test", cid, serverConfig, serverConn, immediateTLS, allowLoginWithoutTLS, viaHTTPS, "")
close(done)
}()
client, err := imapclient.New(connCounter, clientConn, true)
tcheck(t, err, "new client")
opts := imapclient.Opts{
Logger: slog.Default().With("cid", connCounter),
Error: func(err error) { panic(err) },
}
client, _ := imapclient.New(clientConn, &opts)
tc := &testconn{t: t, conn: clientConn, client: client, uidonly: uidonly, done: done, serverConn: serverConn, account: acc}
if first {
tc.switchStop = switchStop