---
title: "Go Coding Style"
description: "> This file extends the common coding style rule with Go specific content."
type: skill
canonical_url: https://claudary.paisolsolutions.com/skills/golang-coding-style
source: "Claudary"
difficulty: intermediate
author: "Claude Code Knowledge Pack"
date: 2026-07-10T11:24:56.082Z
license: CC-BY-4.0
attribution: "Go Coding Style — Claudary (https://claudary.paisolsolutions.com/skills/golang-coding-style)"
---

# Go Coding Style
> This file extends the common coding style rule with Go specific content.

## Overview

---
description: "Go coding style extending common rules"
globs: ["**/*.go", "**/go.mod", "**/go.sum"]
alwaysApply: false
---
# Go Coding Style

> This file extends the common coding style rule with Go specific content.

## Formatting

- **gofmt** and **goimports** are mandatory -- no style debates

## Design Principles

- Accept interfaces, return structs
- Keep interfaces small (1-3 methods)

## Error Handling

Always wrap errors with context:

```go
if err != nil {
    return fmt.Errorf("failed to create user: %w", err)
}
```

## Reference

See skill: `golang-patterns` for comprehensive Go idioms and patterns.

---

Source: [Claudary](https://claudary.paisolsolutions.com/skills/golang-coding-style) · https://claudary.paisolsolutions.com
