Conform Go code to project conventions
- Propagate context.Context through all exported store/service methods
that perform I/O; use QueryContext/ExecContext/QueryRowContext throughout
- Add package-level sentinel errors (ErrNotFound, ErrAlreadyCheckedIn,
ErrNotCheckedIn) and replace nil,nil returns with explicit errors
- Update handlers to use errors.Is() instead of nil checks, with correct
HTTP status codes per error type
- Fix SQLite datetime('now') → MySQL NOW() in volunteer, schedule,
timeoff, and checkin stores
- Refactor db.Migrate to execute schema statements individually (MySQL
driver does not support multi-statement Exec)
- Fix import grouping in handler files (stdlib, external, internal)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -29,7 +30,7 @@ func main() {
|
||||
}
|
||||
defer database.Close()
|
||||
|
||||
if err := db.Migrate(database); err != nil {
|
||||
if err := db.Migrate(context.Background(), database); err != nil {
|
||||
log.Fatalf("migrate database: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user