1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

CHORE: More cleanups (#2632)

This commit is contained in:
Tom Limoncelli
2023-11-19 13:44:49 -05:00
committed by GitHub
parent 159fdf07ad
commit 3dab594757
9 changed files with 38 additions and 15 deletions

View File

@@ -66,13 +66,12 @@ func testFormat(t *testing.T, domain, format string) {
log.Fatal(fmt.Errorf("can't read expected %q: %w", outfile.Name(), err))
}
// // Update got -> want
// err = os.WriteFile(expectedFilename, got, 0644)
// if err != nil {
// log.Fatal(err)
// }
if w, g := string(want), string(got); w != g {
// If the test fails, output a file showing "got"
err = os.WriteFile(expectedFilename+".ACTUAL", got, 0644)
if err != nil {
log.Fatal(err)
}
t.Errorf("testFormat mismatch (-got +want):\n%s", diff.LineDiff(g, w))
}
}