Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

go-review

БесплатноБез исполняемых скриптовНе проверен

Reviewing Go code - what to flag, and what the toolchain already flags for you USE WHEN: you are reviewing, critiquing or auditing existing Go code - a "code…

claude-dev-suiteот claude-dev-suite★ 51 звезда на GitHub

Об этом скилле

Reviewing Go

A reviewer's leverage is what the toolchain cannot say. Every check below describes a defect that survives the compiler, go vet, and a default golangci-lint run (errcheck, govet, ineffassign, staticcheck, unused).

The snippets are fragments cut down to the defect, not runnable programs.

Already covered — do not spend review on it

Defect Reported by
Unchecked error return errcheck (default)
Copying a sync.Mutex or any lock by value go vet (copylocks)
Printf verb/argument mismatch go vet (printf)
Unused variable, unused import the compiler
Unreachable code go vet (unreachable)
wg.Add called inside the goroutine it counts staticcheck SA2000 (default); go vet (waitgroup) from Go 1.25
defer inside for … range <channel> with no break/return staticcheck SA9001
Pre-1.22 loop variable captured by a go/defer as the last statement of the body go vet (loopclosure)
Struct field alignment and padding fieldalignment (opt-in, but a linter question either way)

If the project has no linter configured, that is one review comment about CI — not thirty comments doing the linter's job by hand.

The table above dates; the tools do not. Verify a default set with mcp__documentation__fetch_docs on technology go-quality — topics go-vet, staticcheck-checks, golangci-lint-linters. Those entries point at the indexes the tool authors maintain, so they follow the version the project actually pins rather than the one this skill was written against.

The checks that earn their place

A typed nil in an interface is not a nil interface

type MyError struct{ msg string }

func (e *MyError) Error() string { return e.msg }

func find() *MyError { return nil }   // a typed nil

var err error = find()   // err != nil: the interface holds (*MyError, nil)
if err != nil { /* taken */ }

When you see it: a function returning a concrete pointer type whose result is assigned to error or any interface; an interface-typed struct field assigned from a typed nil.

Ask: does any path put a typed nil into an interface? Return the interface type, or return a literal nil on the success path.

Not reported by anything in the default set. (nilness catches a narrow subset, but it is an opt-in x/tools pass, not part of go vet.)

Errors compared instead of matched

if err == sql.ErrNoRows { }          // breaks as soon as anything wraps it
if errors.Is(err, sql.ErrNoRows) { } // survives %w

When you see it: == against a sentinel error, or a type assertion err.(*MyError) where errors.As belongs.

Ask: does any layer between the source and this comparison wrap with %w? When a wrap is added later, == silently stops matching: the branch quietly stops being taken and nothing fails loudly. (errorlint would catch this, but it is not in the default set.)

The iteration error is never checked

for rows.Next() {
    // scan
}
return items, nil   // a network error ended the loop exactly like a full result set

When you see it: for rows.Next(), for scanner.Scan() — any iterator with a separate Err() — and no rows.Err() / scanner.Err() after the loop.

Ask: how does this function distinguish "read everything" from "stopped early"? It cannot, and the caller gets a truncated result with a nil error.

No linter can report this: errcheck only inspects calls that are written, and here the call is missing.

A mutation applied to the range copy

for _, cfg := range configs {
    cfg.Enabled = true   // writes to a copy; discarded at the next iteration
}

When you see it: an assignment to a field of the value variable of a range over a slice or map of structs.

Ask: was this meant to mutate the collection? Then it needs configs[i] or a slice of pointers. Worth checking deliberately since Go 1.22: people now assume "the loop variable problem" is fixed, and this is the part that never changed.

A lock held across something that can block

mu.Lock()
if err := callService(ctx); err != nil {   // I/O inside the critical section
    return err                             // and an early return with no Unlock
}
mu.Unlock()

When you see it: Lock() without an immediate defer Unlock(), or a critical section containing I/O, a channel send, or a second lock.

Ask: does every path release it, and what is the worst case for a caller waiting on this mutex while that call hangs? copylocks covers copying a lock, never how long one is held.

A goroutine with no way to stop

go func() {
    for range ticker.C { poll() }   // lives until the process exits
}()

When you see it: go func containing a loop, with no ctx.Done(), no quit channel, and no way for the caller to observe completion.

Ask: who stops this, and how does the caller learn that it stopped

Полный SKILL.md на GitHub

Установить go-review в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Grep
Glob

FAQ

Что делает скилл go-review?

Reviewing Go code - what to flag, and what the toolchain already flags for you USE WHEN: you are reviewing, critiquing or auditing existing Go code - a "code review", a "review" of a .go file, a diff, a PR or a pull request; deciding what to comment on in Go; avoiding false positives on Go code DO NOT USE FOR: writing, explaining or learning Go - use `languages/go`; anything `go vet` or a default golangci-lint run already reports (this skill lists those so you can stay silent about them); framework specifics - use the Gin/Echo/Fiber skills

Как установить скилл go-review?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл go-review запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить go-review с