Go 1.25+ Standards

Enforce Go 1.25+ coding standards for error handling, testing, and linting.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill go-1-25-standards-kreuzberg-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Go 1.25+ Standards
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.remote-cache/kreuzberg-shared-rules/.ai-rulez/skills/go-125-standards
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill go-1-25-standards-kreuzberg-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures Go code adheres to modern best practices, improving code quality, maintainability, and reducing bugs.

Core Features & Use Cases

  • Modern Go Features: Enforces use of Go 1.25+ features like error wrapping (fmt.Errorf("%w", err)).
  • Testing Standards: Mandates table-driven tests with t.Run() and black-box testing approaches.
  • Linting & Analysis: Integrates golangci-lint with specific linters and complexity limits.
  • Package Structure: Guides on organizing code into cmd/, internal/, and pkg/.
  • Naming Conventions: Enforces consistent naming across types, variables, and constants.
  • Context Handling: Ensures Context.Context is used correctly for I/O operations and cancellation.
  • Logging: Promotes structured logging with zerolog.

Quick Start

Apply the Go 1.25+ Standards skill to the current Go project to ensure best practices are followed.

Frequently Asked Questions about Go 1.25+ Standards

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

FAQPage Schema
How do I enforce modern Go coding standards for error handling and testing?

You enforce modern Go coding standards by applying rules for error wrapping with `fmt.Errorf("%w", err)` and mandating table-driven tests using `t.Run()` to improve code quality and maintainability.

What is the best way to structure a Go 1.25+ application package?

The best way to structure a Go 1.25+ application is by organizing code into `cmd/`, `internal/`, and `pkg/` directories, which enforces clear boundaries and maintainable package structures across your software engineering project.

How do I configure golangci-lint for Go best practices and complexity limits?

Configure golangci-lint for Go best practices by integrating specific linters and enforcing complexity limits to ensure code quality, maintainability, and adherence to modern Go programming standards across your project.

Does this Go standards approach require structured logging with zerolog?

Yes, this Go standards approach requires structured logging with `zerolog` to ensure consistent log formatting, and it mandates correct `Context.Context` propagation for I/O operations and cancellation.

Can I use these Go linting and naming conventions for my existing libraries?

Yes, you can use these Go linting and naming conventions for existing libraries, as the standards are applicable to software engineering teams developing both Go applications and libraries to improve overall code quality.

Why does my Go code need context propagation for I/O operations?

Your Go code needs context propagation for I/O operations to ensure `Context.Context` is used correctly for cancellation and timeouts, which is a required standard for maintaining robust and modern Go applications.