Skip to content
Back to skills

Staticcheck

ASecurity

Fix staticcheck issues

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 7, 2026
code-qualitygobash

Security analysis

A100/100

Scanned February 12, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Staticcheck?

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

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

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: staticcheck
description: Fix staticcheck issues
---

# staticcheck

Advanced static analyzer with comprehensive checks.

## Install
```bash
go install honnef.co/go/tools/cmd/staticcheck@latest
```

## Usage
```bash
staticcheck ./...
staticcheck -checks=all ./...
```

## Common Issues

### SA1019: Deprecated Function
```go
// Bad
ioutil.ReadFile("file.txt")

// Good
os.ReadFile("file.txt")
```

### SA4006: Unused Value
```go
// Bad
value := compute()
value = other()

// Good
_ = compute()
value := other()
```

### SA9003: Empty Branch
```go
// Bad
if err != nil {
    // TODO
}

// Good - remove or implement
if err != nil {
    return err
}
```

### S1002: Simplify Condition
```go
// Bad
if x == true {
    return true
}

// Good
return x
```

### ST1003: Naming Convention
```go
// Bad
func GetHTTPSUrl() string

// Good
func GetHTTPSURL() string
```

### SA1006: Printf on os.Stderr
```go
// Bad
fmt.Printf("error: %v\n", err)

// Good
fmt.Fprintf(os.Stderr, "error: %v\n", err)
```

### SA4010: Result Not Used
```go
// Bad
append(slice, item)

// Good
slice = append(slice, item)
```

## Configuration
```ini
# .staticcheck.conf
checks = ["all", "-ST1000"]
```

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…