# too many return values
	have (T, error)
	want (T)

- **ID:** `go/too-many-return-values`
- **Domain:** go
- **Category:** compile_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A function expecting a single return value is being assigned or used where a multi-return function is called, often due to mismatched function signatures or missing error handling.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| go1.20 | active | — | — |
| go1.21 | active | — | — |
| go1.22 | active | — | — |

## Workarounds

1. **Assign both return values to variables and handle the error: val, err := someFunc(); if err != nil { ... }** (95% success)
   ```
   Assign both return values to variables and handle the error: val, err := someFunc(); if err != nil { ... }
   ```
2. **If the function should return only one value, wrap it in a helper: func wrapper() T { val, _ := someFunc(); return val }** (85% success)
   ```
   If the function should return only one value, wrap it in a helper: func wrapper() T { val, _ := someFunc(); return val }
   ```

## Dead Ends

- **Adding an underscore to ignore the error: val, _ := someFunc()** — This only works if the caller expects two values; if the caller expects one, the compile error persists. (90% fail)
- **Changing the function signature to remove the error return** — Modifying the library function breaks its contract and may cause other compilation errors. (95% fail)
- **Using a type assertion on the result** — Type assertion cannot reduce the number of return values; it only works on interfaces. (98% fail)
