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
An HR department needs a simple employee directory backend. Build it in Go using the standard library.
Resources:
{ id, name, managerId }{ id, name, email, departmentId, role, hireDate }Endpoints:
GET /api/departments -- list all departmentsPOST /api/departments -- create a department (name required, must be unique)GET /api/departments/{id}/employees -- list employees in a departmentGET /api/employees -- list all employees, with optional ?department={id} filterGET /api/employees/{id} -- get a single employeePOST /api/employees -- create an employee (name, email required; email must be unique; departmentId must reference an existing department)PUT /api/employees/{id} -- update an employeeDELETE /api/employees/{id} -- remove an employee (if the employee is a department manager, reject the deletion)Seed with 2 departments and 5 employees. Use in-memory storage.
Produce:
main.go -- entry pointgo.modOrganize files as appropriate.