2023-05-19 16:23:55 -04:00
|
|
|
# :unicorn: Fx [](https://pkg.go.dev/go.uber.org/fx) [](https://github.com/uber-go/fx/releases) [](https://github.com/uber-go/fx/actions/workflows/go.yml) [](https://codecov.io/gh/uber-go/fx/branch/master) [](https://goreportcard.com/report/go.uber.org/fx)
|
2023-02-22 17:58:17 -04:00
|
|
|
|
2023-05-19 16:23:55 -04:00
|
|
|
Fx is a dependency injection system for Go.
|
2023-02-22 17:58:17 -04:00
|
|
|
|
2023-05-19 16:23:55 -04:00
|
|
|
**Benefits**
|
|
|
|
|
|
|
|
- Eliminate globals: Fx helps you remove global state from your application.
|
|
|
|
No more `init()` or global variables. Use Fx-managed singletons.
|
|
|
|
- Code reuse: Fx lets teams within your organization build loosely-coupled
|
|
|
|
and well-integrated shareable components.
|
|
|
|
- Battle tested: Fx is the backbone of nearly all Go services at Uber.
|
|
|
|
|
|
|
|
See our [docs](https://uber-go.github.io/fx/) to get started and/or
|
|
|
|
learn more about Fx.
|
2023-02-22 17:58:17 -04:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2023-05-19 16:23:55 -04:00
|
|
|
Use Go modules to install Fx in your application.
|
2023-02-22 17:58:17 -04:00
|
|
|
|
|
|
|
```shell
|
|
|
|
go get go.uber.org/fx@v1
|
|
|
|
```
|
|
|
|
|
2023-05-19 16:23:55 -04:00
|
|
|
## Getting started
|
|
|
|
|
|
|
|
To get started with Fx, [start here](https://uber-go.github.io/fx/get-started/).
|
|
|
|
|
2023-02-22 17:58:17 -04:00
|
|
|
## Stability
|
|
|
|
|
2023-08-22 16:02:01 +05:30
|
|
|
This library is `v1` and follows [SemVer](https://semver.org/) strictly.
|
2023-02-22 17:58:17 -04:00
|
|
|
|
|
|
|
No breaking changes will be made to exported APIs before `v2.0.0`.
|
|
|
|
|
2023-05-19 16:23:55 -04:00
|
|
|
This project follows the [Go Release Policy](https://golang.org/doc/devel/release.html#policy). Each major
|
2023-02-22 17:58:17 -04:00
|
|
|
version of Go is supported until there are two newer major releases.
|
|
|
|
|
2023-05-19 16:23:55 -04:00
|
|
|
## Stargazers over time
|
|
|
|
|
|
|
|
[](https://starchart.cc/uber-go/fx)
|
|
|
|
|