Naming, layout and comments: descriptive full-word names, one item per line in wrapped calls and literals, and doc comments on exported names

Short and single-letter names in application code become full words (tests
keep theirs). Wrapped calls, signatures and composite literals put one item
per line, and one-line function bodies are expanded. Exported names and
groups of constants get doc comments, and comments refer to the renamed
identifiers.
This commit is contained in:
bwilliams committed 2026-10-15 16:12:56 +01:00
1 parent 043e307663
commit 465358609a
78 files changed
+2374 -1402

No files matched your search

+8 -3
View File
@@ -16,6 +16,7 @@ import (
// Run with: go test -tags sqlite_fts5 ./...
func tempDBPath(t *testing.T) string {
t.Helper()
return filepath.Join(t.TempDir(), "migrate.db")
}
@@ -25,7 +26,9 @@ func newMigrator(t *testing.T) (*goose.Provider, *sql.DB) {
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() { db.Close() })
t.Cleanup(func() {
db.Close()
})
m, err := store.NewMigrator(db)
if err != nil {
t.Fatal(err)
@@ -93,7 +96,8 @@ func TestOpenRejectsNewerSchema(t *testing.T) {
}
defer db.Close()
if _, err := db.Exec(
`INSERT INTO goose_db_version (version_id, is_applied) VALUES (9999, 1)`); err != nil {
`INSERT INTO goose_db_version (version_id, is_applied) VALUES (9999, 1)`,
); err != nil {
t.Fatal(err)
}
@@ -268,7 +272,8 @@ func TestNewerDatabaseIsRefused(t *testing.T) {
t.Fatal(err)
}
if _, err := db.Exec(
`INSERT INTO goose_db_version (version_id, is_applied) VALUES (9999, 1)`); err != nil {
`INSERT INTO goose_db_version (version_id, is_applied) VALUES (9999, 1)`,
); err != nil {
t.Fatal(err)
}