# http: multiple registrations for /api/v1/users

- **ID:** `go/http-multiple-registrations`
- **Domain:** go
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The same URL pattern is registered multiple times with http.Handle or http.HandleFunc, causing a panic.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Check if pattern is already registered before adding: if _, exists := mux.Handlers()[pattern]; !exists { mux.Handle(pattern, handler) }
   ```
2. **** (85% success)
   ```
   Use a single handler with method-based routing: http.HandleFunc("/api/v1/users", func(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": ... case "POST": ... } })
   ```

## Dead Ends

- **** — Go panics on duplicate registration; this is not allowed. (100% fail)
- **** — Overriding can lead to unexpected behavior and is not idiomatic. (50% fail)
