Skip to content

Commit 6885f85

Browse files
committed
Fix formatting issues, linter warnings and test errors after logger refactor
1 parent b5bd761 commit 6885f85

6 files changed

Lines changed: 12 additions & 8 deletions

File tree

framework/dns/dnssec_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ func TestExtResolver_AuthLookupIPAddr(t *testing.T) {
129129
// AD flag handling for use in DANE algorithms.
130130

131131
// Silence log messages about disregarded I/O errors.
132-
log.DefaultLogger.Out = nil
132+
oldLog := log.DefaultLogger
133+
log.DefaultLogger = log.NopLogger
134+
t.Cleanup(func() {
135+
log.DefaultLogger = oldLog
136+
})
133137

134138
test := func(aAct, aaaaAct TestSrvAction, aAD, aaaaAD, ad bool, addrs []net.IP, err bool) {
135139
t.Helper()

internal/table/file_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestFileReload(t *testing.T) {
119119
t.Fatal(err)
120120
}
121121

122-
mod, err := NewFile(container.New(),"", "")
122+
mod, err := NewFile(container.New(), "", "")
123123
if err != nil {
124124
t.Fatal(err)
125125
}

internal/table/sql_query_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434

3535
func TestSQL(t *testing.T) {
3636
path := testutils.Dir(t)
37-
mod, err := NewSQL(container.New(),"sql_table", "")
37+
mod, err := NewSQL(container.New(), "sql_table", "")
3838
if err != nil {
3939
t.Fatal("Module create failed:", err)
4040
}

internal/target/remote/remote.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ func (rt *Target) InstanceName() string {
208208
type remoteDelivery struct {
209209
rt *Target
210210
mailFrom string
211-
msgMeta *module.MsgMetadata
212-
log *log.Logger
211+
msgMeta *module.MsgMetadata
212+
log *log.Logger
213213

214214
recipients []string
215215
connections map[string]*mxConn

internal/target/remote/remote_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func testTarget(t *testing.T, zones map[string]mockdns.Zone, extResolver *dns.Ex
7575
}
7676

7777
func testSTSPolicy(t *testing.T, zones map[string]mockdns.Zone, mtastsGet func(context.Context, string) (*mtasts.Policy, error)) *mtastsPolicy {
78-
m, err := NewMTASTSPolicy(container.New(),"mx_auth.mtasts", "test")
78+
m, err := NewMTASTSPolicy(container.New(), "mx_auth.mtasts", "test")
7979
if err != nil {
8080
t.Fatal(err)
8181
}
@@ -101,7 +101,7 @@ func testSTSPolicy(t *testing.T, zones map[string]mockdns.Zone, mtastsGet func(c
101101
}
102102

103103
func testDANEPolicy(t *testing.T, extR *dns.ExtResolver) *danePolicy {
104-
m, err := NewDANEPolicy(container.New(),"mx_auth.dane", "test")
104+
m, err := NewDANEPolicy(container.New(), "mx_auth.dane", "test")
105105
if err != nil {
106106
t.Fatal(err)
107107
}

tests/t.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (t *T) buildCmd(additionalArgs ...string) *exec.Cmd {
217217
args := []string{"-config", filepath.Join(t.testDir, "maddy.conf"),
218218
"-debug.smtpport", remoteSmtp,
219219
"-debug.dnsoverride", t.dnsServ.LocalAddr().String(),
220-
"-log", "/tmp/test.log"}
220+
}
221221

222222
if CoverageOut != "" {
223223
args = append(args, "-test.coverprofile", CoverageOut+"."+strconv.FormatInt(time.Now().UnixNano(), 16))

0 commit comments

Comments
 (0)