CtrlK
BlogDocsLog inGet started
Tessl Logo

golang-dependency-injection

Comprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), manual constructor injection, and DI library comparison (google/wire, uber-go/dig, uber-go/fx, samber/do). Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code, managing singletons or service factories, or when the user asks about inversion of control, service containers, or wiring dependencies in Go. For a specific DI library, → See `samber/cc-skills-golang@golang-google-wire`, `samber/cc-skills-golang@golang-uber-dig`, `samber/cc-skills-golang@golang-uber-fx`, or `samber/cc-skills-golang@golang-samber-do` skills.

80

1.00x
Quality

86%

Does it follow best practices?

Impact

83%

1.00x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Evaluation results

70%

Notification Service with Dependency Injection

samber/do container override testing pattern

Criteria
Baseline
With context

do.OverrideValue usage

0%

0%

Injector-resolved service under test

100%

100%

Real service left un-overridden

0%

0%

Interface-boundary mocking

100%

100%

Interface defined at consumer

100%

100%

No global variables for services

100%

100%

Constructor injection

100%

100%

samber/do v2 import

100%

100%

Test verifies email recipient

100%

100%

No service locator pattern

100%

100%

97%

Weather Logger CLI

Manual DI initialization order in Go CLI

Criteria
Baseline
With context

Config initialized first

100%

100%

Store before fetcher

100%

100%

Fetcher before handler

100%

100%

No DI library import

100%

100%

Constructor injection

100%

100%

No global service variables

100%

100%

No init() service setup

100%

100%

Interface at consumer

70%

70%

Composition root in main

100%

100%

Dependencies passed down

100%

100%

Repository
samber/cc-skills-golang
Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.