# missing function body

- **ID:** `go/missing-function-body`
- **Domain:** go
- **Category:** compile_error
- **Verification:** ai_generated
- **Fix Rate:** 92%

## Root Cause

A function declaration has no body because the source file was truncated, the function is defined in another file not compiled, or a build tag caused the body to be excluded.

## Version Compatibility

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

## Workarounds

1. **Provide the missing function body: define the function with a block, e.g., `func foo() int { return 0 }`.** (95% success)
   ```
   Provide the missing function body: define the function with a block, e.g., `func foo() int { return 0 }`.
   ```
2. **If using build tags, ensure the file with the function body is included: `go build -tags "mytag" .` or remove conflicting tags.** (90% success)
   ```
   If using build tags, ensure the file with the function body is included: `go build -tags "mytag" .` or remove conflicting tags.
   ```

## Dead Ends

- **** — The compiler requires an actual block {} not just a return; the function must have a body. (95% fail)
- **** — If the function is called elsewhere, removing it causes undefined errors. (80% fail)
