# panic: sync: Once is reused

- **ID:** `go/once-reuse-panic`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to reuse a sync.Once after it has been used, which is not allowed.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Use a flag with atomic operations to implement single execution: 

var done int32
go func() {
    if atomic.CompareAndSwapInt32(&done, 0, 1) {
        // do once
    }
}()
   ```
2. **** (85% success)
   ```
   Ensure Once is used only once per lifecycle, and create a new instance if needed.
   ```

## Dead Ends

- **** — Copying a sync.Once is unsafe and can cause races; it's not designed to be copied. (90% fail)
- **** — If the Once is embedded in a struct that's reused, it may still be copied. (40% fail)
