Skip to content
Back to skills

Vet

ASecurity

Fix go vet warnings

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 7, 2026
code-qualitygobash

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add JamesPrial/claudefiles --skill vet --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vet?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vet
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jamesprial-vet/badge)](https://www.skillsdirectory.com/skills/jamesprial-vet)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: go-vet
description: Fix go vet warnings
---

# go vet

Built-in static analyzer that catches common mistakes.

## Usage
```bash
go vet ./...
go vet ./pkg/...
```

## Common Warnings

### Printf Format Mismatch
```go
// Bad
fmt.Printf("%d", "string")

// Good
fmt.Printf("%s", "string")
```

### Unreachable Code
```go
// Bad
return value
fmt.Println("never runs")

// Good
fmt.Println("runs")
return value
```

### Composite Literal Uses Unkeyed Fields
```go
// Bad
Person{"Alice", 30}

// Good
Person{Name: "Alice", Age: 30}
```

### Nil Dereference
```go
// Bad
var p *int
fmt.Println(*p)

// Good
if p != nil {
    fmt.Println(*p)
}
```

### Suspicious Mutex Usage
```go
// Bad - mutex copied
func process(mu sync.Mutex) {
    mu.Lock()
}

// Good - pass pointer
func process(mu *sync.Mutex) {
    mu.Lock()
}
```

### Lost Context
```go
// Bad
ctx := context.TODO()

// Good
ctx := context.Background()
// or accept ctx as parameter
```

## Fix All Issues
```bash
go vet ./... 2>&1 | tee vet.log
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…