A dependency injection based application framework for Go that eliminates globals and enables code reuse.
Fx is a dependency injection based application framework for Go that helps developers eliminate global state and build modular, reusable components. It solves the problem of managing dependencies in large-scale Go applications by providing a structured way to inject and manage singletons. The framework is designed to improve code maintainability and testability across teams.
Go developers building scalable, maintainable applications, particularly in organizations where code reuse and modular architecture are priorities. It's especially valuable for teams at companies like Uber that need battle-tested solutions for production services.
Developers choose Fx over alternatives because it's battle-tested at Uber, eliminates the need for global variables, and promotes clean, reusable code. Its focus on dependency injection simplifies testing and integration, making it a reliable choice for enterprise-grade Go applications.
A dependency injection based application framework for Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Fx removes the need for `init()` functions and global variables by using managed singletons, directly addressing a common pain point in Go applications as stated in the README.
It enables teams to build loosely-coupled, shareable components that integrate well across an organization, promoting modularity and scalability in large codebases.
Powers nearly all Go services at Uber, ensuring it has been proven in production environments for reliability and scalability, as highlighted in the key features.
Follows SemVer strictly with no breaking changes before v2.0.0, providing predictability and reducing upgrade friction for developers, per the stability section.
Requires developers to understand dependency injection patterns and write boilerplate code for providers and invokers, which can be a barrier for small teams or simple projects.
As a runtime DI framework, it adds overhead at application startup compared to compile-time alternatives like Wire, which might impact performance in latency-sensitive scenarios.
Deep integration with Fx can make it challenging to migrate to other DI systems or refactor applications later, due to tight coupling with Fx-specific APIs and lifecycle.