CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/go-project-structure

Go project structure -- cmd/internal layout, handler/service/repository layers, Makefile, config from environment, domain error types, test placement, dependency injection

90

1.02x
Quality

84%

Does it follow best practices?

Impact

100%

1.02x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

Evaluation results

100%

2%

Scaffold a Go Blog API with Posts and Comments

Criteria
Without context
With context

cmd/ entry point

100%

100%

internal/ for all packages

100%

100%

Handler layer separated

100%

100%

Service layer with interfaces

100%

100%

Repository layer

100%

100%

Domain types package

100%

100%

Domain error types

83%

100%

Centralized writeError

100%

100%

Config from environment

100%

100%

Makefile

100%

100%

Tests alongside source

100%

100%

Table-driven tests

100%

100%

go.mod

100%

100%

.gitignore

100%

100%

Middleware registered

100%

100%

Graceful shutdown

100%

100%

100%

3%

Build a Go REST API for Warehouse Inventory Management

Criteria
Without context
With context

cmd/ entry point

100%

100%

internal/ for all app code

100%

100%

Handler package with struct

100%

100%

Service layer with repository interfaces

100%

100%

Repository layer

100%

100%

Domain package with models

100%

100%

Domain error types defined

100%

100%

Centralized error response

100%

100%

Config from environment with defaults

100%

100%

Makefile with build and test

66%

100%

Tests alongside source code

100%

100%

Table-driven tests

100%

100%

go.mod present

100%

100%

.gitignore for Go

100%

100%

Graceful shutdown

100%

100%

HTTP server timeouts

100%

100%

100%

Set Up a New Go Microservice for Payment Processing

Criteria
Without context
With context

cmd/server/main.go entry point

100%

100%

internal/ directory used

100%

100%

Handler layer separated

100%

100%

Service layer with interface

100%

100%

Repository layer separated

100%

100%

Domain models in own package

100%

100%

Domain error types

100%

100%

Config from environment

100%

100%

go.mod with module path

100%

100%

Makefile with standard targets

100%

100%

Test files alongside source

100%

100%

Table-driven tests

100%

100%

.gitignore for Go

100%

100%

Constructor-based DI in main.go

100%

100%

Graceful shutdown

100%

100%

100%

2%

Build a Go Task Queue Service with REST API

Criteria
Without context
With context

cmd/ entry point with constructor DI

100%

100%

internal/ directory for all packages

100%

100%

Handler layer with route registration

100%

100%

Service layer defines repository interface

100%

100%

Repository implements interface

100%

100%

Domain models with constants

100%

100%

Domain error types

100%

100%

Config from environment

100%

100%

Comprehensive Makefile

83%

100%

Service test file alongside source

100%

100%

Handler test file alongside source

100%

100%

Table-driven tests with multiple cases

100%

100%

go.mod present

100%

100%

.gitignore

100%

100%

Graceful shutdown

100%

100%

100%

Create a Go User Authentication Service

Criteria
Without context
With context

cmd/ entry point with DI wiring

100%

100%

internal/ for application code

100%

100%

Handler layer with route registration

100%

100%

Service layer with UserRepository interface

100%

100%

Repository layer with SQL

100%

100%

Domain models without password leak

100%

100%

Domain error types

100%

100%

Config from environment -- JWT secret not hardcoded

100%

100%

Makefile with targets

100%

100%

Tests alongside source code

100%

100%

Table-driven tests for auth logic

100%

100%

go.mod present

100%

100%

.gitignore

100%

100%

Graceful shutdown in main

100%

100%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents