Added a convention that sentinel errors go near the top of the file, and applied it

This commit is contained in:
bwilliams committed 2026-10-16 13:23:47 +01:00
1 parent 848edc73e2
commit e32e270db0
5 files changed
+44 -16

No files matched your search

+3 -2
View File
@@ -10,6 +10,9 @@ import (
"github.com/pressly/goose/v3"
)
// errWrite is the error failingWriter fails every write with.
var errWrite = errors.New("write failed")
// The commands are tested through the real command tree in cmd/jobsearch.
// These tests cover reporting a failed migration, which a working set of
// migrations can't trigger.
@@ -92,8 +95,6 @@ func TestPrintResults(t *testing.T) {
// failingWriter fails every write.
type failingWriter struct{}
var errWrite = errors.New("write failed")
func (failingWriter) Write([]byte) (int, error) { return 0, errWrite }
// A write error is returned, and the failed migration is still reported.