go

Guide Go web application and library development with idiomatic structure and testing.

48|8|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/maragudk/skills --skill go
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go
Source: https://github.com/maragudk/skills/tree/main/go
Command: npx skills add https://github.com/maragudk/skills --skill go

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires golangci-lint.

What problem does it solve?

Developing Go applications and libraries requires adherence to specific architectural patterns, testing methodologies, and code styles to ensure maintainability and quality. This Skill provides a comprehensive guide to navigate these complexities, ensuring your Go projects are robust and idiomatic.

Core Features & Use Cases

  • Go Application Structure: Understand typical package layouts for web applications and libraries, including main, model, sql, http, and html packages.
  • Code Style & Best Practices: Learn about dependency injection, testing with subtests and table-driven tests, variable naming conventions, and documentation standards.
  • Testing & Evaluation: Guidance on running tests, linters, and LLM evaluations, including using real dependencies with Docker and database fixtures.
  • Use Case: When tasked with building a new Go web service, this skill provides the blueprint for structuring the project, writing idiomatic Go code, and implementing robust tests, ensuring consistency with established patterns and reducing development time.

Quick Start

Run all tests for the project

make test

or

go test -shuffle on ./...

Frequently Asked Questions about go

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Go web application project?

Go web applications typically use a package-based structure with `main`, `model`, `sql`, `http`, and `html` packages. This organization separates concerns—models for data, sql for database access, http for handlers, and html for templates—making code maintainable and testable.

What testing practices should I follow in Go development?

Go projects should implement table-driven tests, subtests, and integration tests with real dependencies using Docker and database fixtures. This comprehensive approach validates both unit behavior and integration points, catching bugs earlier and ensuring reliability.

How do I apply dependency injection in Go?

Dependency injection in Go involves passing dependencies (databases, HTTP clients, LLM services) as function parameters or struct fields rather than using global state. This pattern improves testability, reduces coupling, and makes components easier to mock and test in isolation.

What Go code style and naming conventions should I use?

Follow idiomatic Go conventions: use meaningful variable names, write concise documentation, organize packages logically, and enforce standards with linters like golangci-lint. Consistent style across your codebase improves readability and reduces maintenance overhead.

Can I use Go for building libraries as well as applications?

Yes, Go supports both. Libraries follow similar architectural principles as applications—using clear package layouts, comprehensive testing with table-driven tests and subtests, and dependency injection. This ensures your library is composable, testable, and follows Go conventions.