golang-samber-do

Configure Go application dependencies with type-safe dependency injection.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/matdev83/go-llm-interactive-proxy --skill golang-samber-do-matdev83
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-do
Source: https://github.com/matdev83/go-llm-interactive-proxy/tree/main/.agents/skills/golang-samber-do
Command: npx skills add https://github.com/matdev83/go-llm-interactive-proxy --skill golang-samber-do-matdev83

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires github.com/samber/do/v2, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies managing dependencies in Go applications by providing a type-safe, flexible dependency injection toolkit.

Core Features & Use Cases

  • Service Registration: Easily register services with lazy, eager, transient, or value lifecycles for modular setup.
  • Dependency Resolution: Retrieve dependencies safely using injection functions, supporting interface-based programming.
  • Use Case: Configure a web server with interconnected components like database, cache, and logger, ensuring proper initialization order and lifecycle management.

Quick Start

Use the samber/do skill to set up dependency injection by creating containers, registering services, and resolving dependencies effectively.

Frequently Asked Questions about golang-samber-do

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage dependency injection in Go for a clean architecture?

Managing dependency injection in Go involves using a flexible, type-safe toolkit to register services and resolve dependencies safely. This ensures clean architecture and proper initialization order for interconnected components like databases and caches.

How do I register services with different lifecycles in a Go application?

You can register services in a Go application using lazy, eager, transient, or value lifecycles. This modular setup allows you to control how and when dependencies are initialized and managed throughout the application lifecycle.

Can I resolve dependencies using interfaces in Go?

Yes, you can resolve dependencies safely using injection functions that support interface-based programming. This allows you to retrieve dependencies dynamically while maintaining type safety and flexibility in your Go codebase.

What is the best way to configure a web server with interconnected database and cache components in Go?

The best way to configure a web server with interconnected components in Go is by using a dependency injection toolkit. It ensures proper initialization order and lifecycle management for databases, caches, and loggers.

Does dependency injection work with lazy and eager initialization in Go?

Yes, dependency injection works with both lazy and eager initialization in Go, alongside transient and value lifecycles. This flexibility allows developers to optimize service registration and resource loading based on specific application requirements.