template-arch-lint

module
v0.0.0-...-9815e70 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT

README ΒΆ

Template Architecture Lint

Copy-paste configuration files for enterprise-grade Go linting. This is NOT a library to installβ€”it's a template to copy from.

Table of Contents

Overview

A reference implementation and configuration template demonstrating:

  • Clean Architecture enforced by go-arch-lint
  • 99+ linters via golangci-lint with maximum strictness
  • Zero-tolerance quality: magic numbers, banned patterns (interface{}, any, panic()), complexity limits
  • Security scanning: gosec, govulncheck, NilAway (80% panic reduction)

The Go code showcases proper architecture boundariesβ€”copy these configs to your real projects.

🎯 THE VALUE: COPY THESE 3 FILES TO YOUR PROJECT

This is NOT a library to install - it's a template to copy from!

THESE 3 FILES ARE WHAT YOU NEED:
  1. .go-arch-lint.yml - Enforces Clean Architecture boundaries (Domain β†’ Application β†’ Infrastructure)
  2. .golangci.yml - 40+ linters with maximum strictness (magic numbers, strings, security, complexity)
  3. justfile - 30+ commands for just lint, just test, just security-audit, etc.
πŸš€ ULTRA-SIMPLE: ONE COMMAND SETUP
# 🎯 RECOMMENDED: One command that does EVERYTHING
curl -fsSL https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/bootstrap.sh | bash

# ✨ Or safer two-step (for paranoid users):
curl -fsSL https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/bootstrap.sh -o bootstrap.sh
chmod +x bootstrap.sh && ./bootstrap.sh

# πŸ”§ Or if you already have the config files:
just bootstrap

What the bootstrap does FOR YOU:

  • βœ… Verifies your Go project + git repository
  • βœ… Checks/installs required tools (go, curl, git, just)
  • βœ… Downloads all 3 config files (.go-arch-lint.yml, .golangci.yml, justfile)
  • βœ… Installs all linting tools (golangci-lint, go-arch-lint)
  • βœ… Verifies everything works correctly
  • βœ… Provides clear next steps
  • βœ… Rolls back on any error - completely safe!
MANUAL COPY-PASTE (If you prefer):
# Get the configs manually:
curl -fsSL -o .go-arch-lint.yml https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/.go-arch-lint.yml
curl -fsSL -o .golangci.yml https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/.golangci.yml
curl -fsSL -o justfile https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/justfile

# Install the linters:
just install

# Start using immediately:
just lint        # Run ALL quality checks
just lint-arch   # Architecture boundaries only
just security-audit  # Complete security scan

These configs enforce:

  • βœ… Architecture boundaries - Domain stays pure, no circular dependencies
  • βœ… Magic number/string detection - goconst + mnd linters
  • βœ… Security scanning - gosec + govulncheck + NilAway (80% panic reduction)
  • βœ… Code quality - 40+ linters, max 50 lines per function, complexity limits
  • βœ… Zero tolerance - forbidigo bans interface{}, any, panic(), print statements

Features

  • πŸ—οΈ Architecture Enforcement Enforces Clean Architecture and DDD boundaries automatically with go-arch-lint

  • πŸ”’ Enterprise Security 40+ linters including NilAway, gosec, and custom security rules

  • 🚨 Zero Tolerance Quality Maximum strictness configuration with zero technical debt tolerance

  • πŸ€– Complete Automation Integrated CI/CD pipeline with pre-commit hooks and auto-fixing

  • πŸ“Š Production Ready Docker containerization, monitoring, and enterprise deployment patterns

πŸš€ INSTANT SETUP - Zero-Friction Installation

🎯 Get from zero to enterprise-grade linting in under 2 minutes:

curl -fsSL https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/bootstrap.sh | bash

That's it! The bootstrap script:

  • βœ… Verifies you're in a Go project with git
  • βœ… Installs missing tools (including just command runner)
  • βœ… Downloads all configuration files
  • βœ… Installs all linting tools
  • βœ… Verifies everything works
  • βœ… Rolls back if anything fails

πŸ›‘οΈ Safety First? Download and inspect before running:

curl -fsSL https://raw.githubusercontent.com/LarsArtmann/template-arch-lint/master/bootstrap.sh -o bootstrap.sh
chmod +x bootstrap.sh && ./bootstrap.sh

πŸ”§ Already have config files? Just run:

just bootstrap  # Verifies and installs everything needed
Prerequisites (Auto-detected & installed)
  • βœ… Go 1.19+ (will check version compatibility)
  • βœ… Git repository (will verify you're in one)
  • βœ… curl (for downloading files)
  • βœ… just command runner (will install automatically if missing)

The bootstrap script handles all of this automatically!

Usage

Development

Quick Development Setup

πŸš€ Get the complete development environment running instantly:

git clone https://github.com/LarsArtmann/template-arch-lint.git
cd template-arch-lint
just bootstrap  # Installs everything needed + verifies setup
go mod download  # Download Go dependencies

That's it! The just bootstrap command handles all tool installation and verification.

Prerequisites (Auto-detected)
  • βœ… Go 1.19+ (bootstrap will verify version)
  • βœ… Git (for cloning repository)
  • βœ… just command runner (bootstrap will install if missing)
  • βœ… All linting tools (bootstrap installs automatically)
Available Commands
πŸ”₯ ESSENTIAL COMMANDS (Copy these to your workflow!)
just install         # Install ALL linting tools (one-time setup)
just lint            # Run EVERYTHING: architecture + code + security (40+ linters)
just fix             # Auto-fix all fixable issues
just test            # Run tests with coverage
just build           # Build the application
πŸ—οΈ Architecture & Quality
just lint-arch       # Clean Architecture boundary validation
just lint-code       # Code quality linting (complexity, naming, etc.)
just lint-strict     # Maximum strictness mode
just graph           # Generate flow architecture graph (SVG)
just graph-di        # Generate dependency injection graph
just graph-vendor    # Generate graph with vendor dependencies
just graph-all       # Generate ALL architecture graphs
just graph-component <name> # Generate focused component graph
πŸ”’ Security & Safety
just security-audit  # Complete security scan (gosec + govulncheck + licenses)
just lint-nilaway    # NilAway: 80% panic reduction
just lint-vulns      # CVE vulnerability scanning
just lint-deps-advanced  # Advanced dependency analysis
🧹 Formatting & Generation
just format          # gofumpt + goimports formatting
just templ           # Generate templ templates
just lint-cycles     # Import cycle detection
just lint-goroutines # Goroutine leak detection

Contributing

Development Guidelines
  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

LarsArtmann

Project Link: https://github.com/LarsArtmann/template-arch-lint

Directories ΒΆ

Path Synopsis
internal
application/handlers
Package handlers provides ...
Package handlers provides ...
config
Package config provides configuration management for the application.
Package config provides configuration management for the application.
domain/entities
Package entities contains the core domain entities for the application.
Package entities contains the core domain entities for the application.
domain/ids
Package ids provides branded, strongly-typed identifiers using go-branded-id.
Package ids provides branded, strongly-typed identifiers using go-branded-id.
domain/repositories
Package repositories provides domain repository interfaces and implementations.
Package repositories provides domain repository interfaces and implementations.
domain/services
Package services provides domain service implementations for business logic.
Package services provides domain service implementations for business logic.
domain/services/testhelpers
Package services_test provides ...
Package services_test provides ...
domain/values
Package values provides domain value objects with validation.
Package values provides domain value objects with validation.
infrastructure
Package infrastructure provides ...
Package infrastructure provides ...
infrastructure/db
Package sqlite provides ...
Package sqlite provides ...
testhelpers/base
Package base provides ...
Package base provides ...
testhelpers/domain/entities
Package entities provides ...
Package entities provides ...
testhelpers/domain/validation
Package validation provides ...
Package validation provides ...
testhelpers/domain/values
Package values provides ...
Package values provides ...
pkg
errors
Package errors provides centralized error definitions for the entire project ALL error definitions MUST be in this package - no exceptions
Package errors provides centralized error definitions for the entire project ALL error definitions MUST be in this package - no exceptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL