Error handling for Go HTTP servers — structured error responses, error wrapping,
88
81%
Does it follow best practices?
Impact
99%
1.80xAverage score across 5 eval scenarios
Passed
No known issues
A parking garage needs a backend API to manage parking spot reservations. Build it in Go using the standard library.
Resources:
{ id, level, number, type (regular/handicap/ev), isAvailable }{ id, spotId, licensePlate, startTime, endTime, createdAt }Endpoints:
GET /api/spots -- list all spots, with optional ?type=ev&available=true filtersGET /api/spots/{id} -- get a single spotPOST /api/spots -- create a spot (level and number required; combination must be unique)POST /api/reservations -- create a reservation:
GET /api/reservations/{id} -- get a reservationDELETE /api/reservations/{id} -- cancel a reservation (mark the spot as available again)Seed with 10 parking spots across 2 levels. Use in-memory storage.
Produce:
main.go -- entry point and server setupgo.modYou may organize files as you see fit.