Show HN: Dwarfreflect – Extract Go function parameter names at runtime
1 points
18 hours ago
| 0 comments
| github.com
| HN
While working on openai-agents-go, I wanted users to define tools by passing in a plain Go function and have the agent figure out the inputs automatically.

But I ran into a gap: Go's reflect gives you parameter types and positions, but not the actual names you wrote.

So I built dwarfreflect: it parses the DWARF debug info embedded in Go binaries (unless stripped) to recover real function parameter names at runtime.

This made it easy to: - Bind incoming JSON/map data to actual parameter names - Build a clean API without boilerplate

Try it out here: https://github.com/matteo-grella/dwarfreflect

Happy to hear thoughts, ideas, use cases, or bug reports.

No one has commented on this post.