linting-go-code

Lint and format Go code with golangci-lint, gofumpt, and goimports.

2|Updated Aug 6, 2021
One-click install
npx skills add https://github.com/MrPointer/dotfiles --skill linting-go-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: linting-go-code
Source: https://github.com/MrPointer/dotfiles/tree/main/.claude/skills/linting-go-code
Command: npx skills add https://github.com/MrPointer/dotfiles --skill linting-go-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the need for consistent, high-quality Go code by automating the process of linting, formatting, and identifying potential issues.

Core Features & Use Cases

  • Code Linting: Runs golangci-lint to enforce coding standards and catch errors.
  • Code Formatting: Applies consistent code style using gofumpt and goimports.
  • Spell Checking: Identifies and helps correct spelling errors in code comments and strings.
  • Use Case: Before committing code, run this Skill to automatically fix formatting issues and ensure the code adheres to project linting rules, preventing merge conflicts and improving maintainability.

Quick Start

Run the task lint command to check and fix Go code.

Frequently Asked Questions about linting-go-code

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

FAQPage Schema
How do I lint and format Go code automatically before committing?

To lint and format Go code before committing, run this Skill within your Go module root directory to apply golangci-lint checks and gofumpt/goimports formatting, automatically fixing style issues and enforcing project rules.

What is the best way to enforce consistent code style in a Golang project?

The best way to enforce consistent Go code style is using automated linting tools like golangci-lint combined with formatters such as gofumpt and goimports, which catch errors and standardize formatting across the module.

Does golangci-lint check for spelling errors in Go code comments?

Yes, golangci-lint can be configured to identify spelling errors in Go code comments and strings, helping improve code readability and maintainability alongside standard style enforcement.

Can I use gofumpt and goimports together for Go code formatting?

Yes, you can use gofumpt and goimports together for Go code formatting. This Skill applies both tools within a Go module to ensure consistent code style and import organization.

Why should I run automated linting checks on my Go module?

Running automated linting checks on your Go module prevents merge conflicts, improves maintainability, and ensures code adheres to project linting rules by catching potential errors and formatting inconsistencies before commit.