CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/go-error-handling

Error handling for Go HTTP servers — structured error responses, error wrapping,

88

1.80x
Quality

81%

Does it follow best practices?

Impact

99%

1.80x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Build an Employee Directory API

Problem/Feature Description

An HR department needs a simple employee directory backend. Build it in Go using the standard library.

Resources:

  • Department: { id, name, managerId }
  • Employee: { id, name, email, departmentId, role, hireDate }

Endpoints:

  • GET /api/departments -- list all departments
  • POST /api/departments -- create a department (name required, must be unique)
  • GET /api/departments/{id}/employees -- list employees in a department
  • GET /api/employees -- list all employees, with optional ?department={id} filter
  • GET /api/employees/{id} -- get a single employee
  • POST /api/employees -- create an employee (name, email required; email must be unique; departmentId must reference an existing department)
  • PUT /api/employees/{id} -- update an employee
  • DELETE /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.

Output Specification

Produce:

  • main.go -- entry point
  • Source files for handlers, models, errors, and middleware
  • go.mod

Organize files as appropriate.

evals

scenario-1

criteria.json

task.md

tile.json