# panic: runtime error: invalid memory address or nil pointer dereference (using atomic on non-pointer)

- **ID:** `go/atomic-misuse`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using atomic operations on non-atomic variables or misusing atomic functions, causing data races and panics.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.19 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   var v atomic.Int32
v.Store(42)
val := v.Load()
   ```
2. **** (85% success)
   ```
   var x int64
atomic.AddInt64(&x, 1) // correct usage
   ```

## Dead Ends

- **** — Regular variables are not thread-safe, causing data races. (80% fail)
- **** — Redundant and may cause performance issues, but not a direct fix for misuse. (50% fail)
