# cannot use (variable of type T) as type *T in argument

- **ID:** `go/cannot-use-type-without-star`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 92%

## Root Cause

A function expects a pointer to a type (*T) but receives a non-pointer value (T), causing a type mismatch.

## Version Compatibility

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

## Workarounds

1. **Pass the address of the variable: `functionName(&variable)` instead of `functionName(variable)`.** (95% success)
   ```
   Pass the address of the variable: `functionName(&variable)` instead of `functionName(variable)`.
   ```
2. **If the variable is not addressable (e.g., map value), copy it first: `tmp := variable; functionName(&tmp)`.** (90% success)
   ```
   If the variable is not addressable (e.g., map value), copy it first: `tmp := variable; functionName(&tmp)`.
   ```

## Dead Ends

- **** — Casting requires the value to be addressable; this often leads to another compilation error. (70% fail)
- **** — Modifying library or external function signatures is not always possible or breaks other code. (60% fail)
