https://github.com/grindlemire/graft
I typically dislike DI frameworks due to all the magic and heavy boilerplate. In Go specifically, I’ve found that tools like Wire or Fx feel too heavy for anything smaller than a huge enterprise repo. However, I still routinely run into wiring spaghetti in larger code bases that make them a pain to work in.
Graft tries to find a middle ground while staying very much a library and not a framework. It is type safe, has no reflection or codegen, and the compiler can provide compile-time cycle and missing dependency detection. I also include a one line test helper to verify your entire dependency graph is complete and cycle free in CI.
I’ve been using this in a few projects and it has held up really well, providing just enough structure without the typical magic of DI or complex argument routing of manual wiring.
I’d love to get your feedback on it!