awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com

Go Dependency Injection Toolkits

Ranking updated Jun 30, 2026

For a dependency injection toolkit for Go services, the first results are google/wire (Wire is a compile-time dependency injection framework for Go that generates code to wire components together via constructor injection and automatic resolution, fitting your need for decoupled dependencies, though it may not explicitly cover scope management or lifecycle hooks), samber/do and uber-go/fx (Fx is a Go dependency injection framework that provides constructor injection, automatic dependency resolution, and lifecycle hooks, though it uses runtime reflection rather than compile-time code generation — a solid fit for decoupled dependencies in Go services). uber-go/dig and golobby/container round out the shortlist. Compare the match explanations and check the project documentation against your requirements.

Libraries and frameworks for managing object dependencies and service wiring in Go applications.

Go Dependency Injection Toolkits

Find the best repos with AI.We'll search the best matching repositories with AI.
  • google/wiregoogle avatar

    google/wire

    14,403View on GitHub↗

    Wire is a compile-time dependency injection framework for Go that generates code to wire application components together. It analyzes function signatures at compile time to build an explicit initialization graph, removing the need for runtime reflection or manual wiring code. The framework operates as a Go code generator and static analysis tool, transforming annotated source code into generated wire files that compile alongside the original project. It connects dependencies by matching function parameters and return types, producing a directed acyclic graph of component dependencies that is

    Wire is a compile-time dependency injection framework for Go that generates code to wire components together via constructor injection and automatic resolution, fitting your need for decoupled dependencies, though it may not explicitly cover scope management or lifecycle hooks.

    GoCompile-Time Dependency Injection FrameworksCompile-Time Dependency Resolution
    View on GitHub↗14,403
  • samber/dosamber avatar

    samber/do

    2,645View on GitHub↗

    This project is a type-safe dependency injection framework for Go that manages application lifecycles and injects dependencies into structures using reflection and metadata tags. It functions as a service lifecycle manager and an interface binding library to decouple service consumption from concrete implementations. The framework utilizes a hierarchical service container, organizing services into a tree of nested scopes where child containers inherit dependencies from their ancestors. It includes a dependency graph visualizer for inspecting relationships and invocation chains, as well as a s

    samber/do is a type-safe dependency injection framework for Go that supports constructor injection, hierarchical scopes, and lifecycle management (start/stop hooks), but it uses reflection rather than compile-time code generation, which matches the core category while missing the requested compile-time injection feature.

    GoAutomatic Constructor InjectionGo DI FrameworksComponent Service Scoping
    View on GitHub↗2,645
  • uber-go/fxuber-go avatar

    uber-go/fx

    7,354View on GitHub↗

    Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model container that automates the instantiation and connection of components by analyzing constructor parameters and return values to resolve complex dependency graphs. The framework distinguishes itself through module-based component bundling, which encapsulates related constructors into reusable units to manage visibility and logic. It provides advanced resolution capabilities, including mapping concrete types to interfaces for decoupling, resolving dependency ambiguities via unique

    Fx is a Go dependency injection framework that provides constructor injection, automatic dependency resolution, and lifecycle hooks, though it uses runtime reflection rather than compile-time code generation — a solid fit for decoupled dependencies in Go services.

    GoAutomatic Constructor InjectionGo DI Frameworks
    View on GitHub↗7,354
  • uber-go/diguber-go avatar

    uber-go/dig

    4,470View on GitHub↗

    dig is a reflection-based dependency injection framework and object graph resolver for Go. It functions as a container that automatically satisfies type dependencies and manages the instantiation of complex networks of objects during application startup. The project utilizes a directed acyclic graph to determine the necessary sequence for object instantiation and employs interface-driven provider mapping to decouple concrete implementations from their satisfied interfaces. It resolves the object hierarchy through reflection-based type resolution and single-pass component wiring to ensure all

    uber-go/dig is a reflection-based dependency injection toolkit for Go that provides constructor injection and automatic resolution, fitting the core request for a DI framework, though it lacks built-in scope management, lifecycle hooks, and compile-time generation.

    GoGo DI Frameworks
    View on GitHub↗4,470
  • golobby/containergolobby avatar

    golobby/container

    613View on GitHub↗

    A lightweight yet powerful IoC dependency injection container for the Go programming language

    golobby/container is a lightweight IoC dependency injection container for Go that supports constructor injection and automatic resolution, squarely fitting the search for a Go dependency injection framework for decoupled services, though it may lack lifecycle hooks or compile-time code generation.

    GoDependency Injection
    View on GitHub↗613
  • goava/digoava avatar

    goava/di

    241View on GitHub↗

    🛠 A full-featured dependency injection container for go programming language.

    Goava/di is a full-featured dependency injection container for Go, directly matching the need for decoupling dependencies in services, though details on specific features like lifecycle hooks or compile-time injection are not confirmed.

    GoDependency Injection
    View on GitHub↗241
  • codegangsta/injectcodegangsta avatar

    codegangsta/inject

    978View on GitHub↗

    Inject is a dependency injection library for Go that manages object lifecycles and wires application components by automating the provision of dependencies. It functions as a reflection-based container that maps specific values to their corresponding types, enabling the automatic retrieval and injection of objects into application logic. The library distinguishes itself through its ability to perform automatic function invocation, where it inspects function signatures at runtime to resolve and provide required arguments from a central registry. It also supports struct field injection, which p

    codegangsta/inject is a dependency injection library for Go that provides the core capability of injecting dependencies to decouple services, fitting the requested category, though its simple description does not indicate support for advanced features like scope management or lifecycle hooks.

    GoDependency Injection FrameworksDependency Injection ContainersDependency Injection Libraries
    View on GitHub↗978
  • micronaut-projects/micronaut-coremicronaut-projects avatar

    micronaut-projects/micronaut-core

    6,418View on GitHub↗

    Micronaut Application Framework

    Micronaut is a JVM-based dependency injection framework for Java, Kotlin, and Groovy, but your search specifically asks for a Go library, so it does not fit the language requirement.

    JavaCompile-Time Dependency Injection Frameworks
    View on GitHub↗6,418
  • microsoft/tsyringemicrosoft avatar

    microsoft/tsyringe

    5,960View on GitHub↗

    tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class implementations from object creation by managing dependencies and object lifecycles using decorators and metadata. The framework features a hierarchical container system where child containers can maintain independent registration scopes and fall back to parent containers for dependency resolution. It provides a provider system that controls object longevity through singleton and transient instantiation rules. The system supports recursive constructor injection and handles circular

    This is a TypeScript dependency injection container, not one for Go applications—so it addresses the dependency injection concept but in the wrong language ecosystem for your search.

    TypeScriptAutomatic Constructor Injection
    View on GitHub↗5,960
  • square/daggersquare avatar

    square/dagger

    7,281View on GitHub↗

    Dagger is a compile-time dependency injection framework for Java and Android that automates object creation and lifecycle management. It functions as a static dependency injector and graph validator, resolving object requirements during the build process to avoid runtime reflection and prevent crashes caused by missing bindings. The framework distinguishes itself by using static analysis and code generation to produce factory classes at build time. It employs qualifier-based type differentiation to manage multiple implementations of the same type and provides scope-based lifecycle management

    Dagger is a compile-time dependency injection framework for Java and Android, not for Go, so it does not match the language requirement even though it squarely fits the dependency injection concept.

    JavaDependency Scopes
    View on GitHub↗7,281
  • livebud/budlivebud avatar

    livebud/bud

    5,584View on GitHub↗

    Bud is a full-stack web framework for Go that functions as a scaffolding engine and code generation tool. It automates the creation of directory structures, controllers, and glue code to streamline the development of web applications. The framework utilizes a transpiler-based approach to produce application boilerplate and provides a development environment featuring hot reloading and local server management. It enables the compilation of applications into single, standalone binaries with support for cross-platform compilation across different operating systems and architectures. The system

    Bud is a full-stack web framework for Go that includes dependency injection patterns as part of its code generation and scaffolding, but it is not a dedicated dependency injection framework for Go services, making it an adjacent rather than direct fit.

    JavaScriptDependency Injection Patterns
    View on GitHub↗5,584
Compare the top 10 at a glance
RepositoryStarsLanguageLicenseLast push
google/wire14.4KGoApache-2.0Aug 22, 2025
samber/do2.6KGomitFeb 19, 2026
uber-go/fx
7.4K
Go
mit
Dec 27, 2025
uber-go/dig4.5KGoMITMay 13, 2025
golobby/container613GoMITAug 28, 2025
goava/di241GoMITDec 16, 2023
codegangsta/inject978GoMITJul 31, 2021
micronaut-projects/micronaut-core6.4KJavaApache-2.0Jun 23, 2026
microsoft/tsyringe6KTypeScriptMITJan 21, 2026
square/dagger7.3KJavaApache-2.0Aug 26, 2021

Related searches

  • a dependency injection container for Python
  • a dependency injection library for TypeScript
  • a dependency injection library for C#
  • a dependency injection container for PHP
  • a dependency injection framework for Java
  • a Go framework for building microservices
  • a configuration loading library for Go applications
  • a Go framework for building CLI tools