# cannot embed function type T

- **ID:** `go/cannot-embed-function-type`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 92%

## Root Cause

Go does not allow embedding function types directly in structs; only interface types can be embedded.

## Version Compatibility

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

## Workarounds

1. **Define an interface type with the same method signature and embed that interface instead** (95% success)
   ```
   Define an interface type with the same method signature and embed that interface instead
   ```
2. **Use a named struct field with the function type** (90% success)
   ```
   Use a named struct field with the function type
   ```

## Dead Ends

- **** — Embedding requires a type name, not a value; a function field is a different semantic (has-a vs is-a). (70% fail)
- **** — Aliases do not change the fundamental type category; embedding still fails. (90% fail)
