mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-22 21:41:01 +01:00
Move log.Fatalf call to end so that we log all unused goldens before failing the program
This commit is contained in:
parent
db19d8ebf1
commit
20fce0ef02
@ -61,6 +61,7 @@ func checkGoldensUsed() {
|
||||
}
|
||||
|
||||
// And check for mismatches
|
||||
var unusedGoldenErr error = nil
|
||||
for _, f := range files {
|
||||
goldenName := path.Base(f.Name())
|
||||
if !slices.Contains(usedGoldens, goldenName) {
|
||||
@ -73,11 +74,13 @@ func checkGoldensUsed() {
|
||||
// It is for another OS
|
||||
continue
|
||||
}
|
||||
err = fmt.Errorf("golden file %v was never used", goldenName)
|
||||
fmt.Println(err)
|
||||
log.Fatalf("%v", err)
|
||||
unusedGoldenErr = fmt.Errorf("golden file %v was never used", goldenName)
|
||||
fmt.Println(unusedGoldenErr)
|
||||
}
|
||||
}
|
||||
if unusedGoldenErr != nil {
|
||||
log.Fatalf("%v", unusedGoldenErr)
|
||||
}
|
||||
|
||||
// And print out anything that is in UNUSED_GOLDENS that was actually used, so we
|
||||
// can manually trim UNUSED_GOLDENS
|
||||
|
Loading…
Reference in New Issue
Block a user