# panic: send on receive-only channel

- **ID:** `go/channel-direction-mismatch`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to send on a channel that is declared as receive-only (<-chan), or receive on a send-only channel (chan<-). This is a compile-time error, but can occur if type assertions are used incorrectly at runtime.

## Version Compatibility

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

## Workarounds

1. **** (98% success)
   ```
   func producer(ch chan<- int) {
    ch <- 1
}

func consumer(ch <-chan int) {
    v := <-ch
    fmt.Println(v)
}

ch := make(chan int)
go producer(ch)
consumer(ch)
   ```
2. **** (95% success)
   ```
   ch := make(chan int)

go func(ch chan<- int) {
    ch <- 42
}(ch)

v := <-ch
fmt.Println(v)
   ```

## Dead Ends

- **** — Type assertions cannot change channel direction; it's a static property. (100% fail)
- **** — The program will panic or fail to compile. (100% fail)
