go-kid/ioc framework dependency injection debugging guide. ALWAYS use this skill when the user encounters ANY errors, failures, or issues with go-kid/ioc, especially: injection errors, component not found, circular dependency, startup panics, wire tag not working, nil dependencies, missing components, constructor parameter resolution failures, config values not injected, or post-processor not applied. Also use for debugging questions like 'why is my component nil', 'injection failed error', 'component X not found', 'how to enable debug mode', 'how to trace dependency resolution', 'my IoC app won't start', 'panic in ioc.Run', 'circular reference error', or ANY go-kid/ioc troubleshooting and error diagnosis. Triggers on: error, failed, panic, not found, nil, not working, missing, debug, debugging, trace, app.LogTrace, RunDebug, injection failed, component not found, circular dependency, dependency resolution failed, wire tag not working, required property empty, constructor parameter not resolved.
go-kid/ioc framework development guide covering component dependency injection, configuration binding, and application lifecycle. ALWAYS use this skill when the user asks about: dependency injection, wiring components, component registration, wire tag, constructor injection, config injection, value/prop/prefix tags, placeholders ${...}, expressions #{...}, application startup, ioc.Run, app.NewApp, lifecycle methods (Init/AfterPropertiesSet/Run/Close), ApplicationRunner, graceful shutdown, or ANY go-kid/ioc development questions. Also use for questions like 'how do I inject X', 'how to load config', 'how to start my app', 'what's the startup sequence', 'how to choose between implementations', 'config value not working', or any component wiring, configuration binding, and lifecycle management. Triggers on: dependency injection, DI, IoC, wire tag, component registration, ioc.Register, ioc.Provide, app.SetComponents, constructor injection, value tag, prop tag, prefix tag, config, ${...}, #{...}, ConfigurationProperties, ioc.Run, ioc.RunWithContext, app.NewApp, ApplicationRunner, lifecycle, Init, AfterPropertiesSet, Close, startup, shutdown, Qualifier, Primary, NamingComponent, ScopeComponent, ConditionalComponent, LazyInit, Ordered, events.
go-kid/ioc framework extension and testing guide. ALWAYS use this skill when the user asks about: extending IoC container, creating PostProcessors, custom tag processing, custom config loaders/binders, writing tests, testing IoC components, ioc.RunTest/RunErrorTest, slog integration, AOP/proxies, or advanced framework customization. Also use for questions like 'how to write tests for IoC', 'how to create custom tag', 'how to extend the container', 'how to add my own PostProcessor', 'how to test dependency injection', 'how to use slog with ioc', 'how to implement AOP', 'how to intercept component creation', 'how to customize property injection', or any go-kid/ioc testing, extension, and advanced customization questions. Triggers on: test, testing, ioc.RunTest, ioc.RunErrorTest, PostProcessor, ComponentPostProcessor, custom tag, extension, extend, customize, slog, logging, AOP, proxy, InstantiationAwareComponentPostProcessor, DefinitionRegistryPostProcessor, custom loader, custom binder.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
English | 中文
go-kid/ioc is a Go runtime dependency injection (IoC/DI) framework based on tag + interface.
wire tag)
value / prop / prefix tags)
${...}#{...} (arithmetic, logical, conditional, collection operations)context.Context lifecycle support: WithContext variants for all lifecycle interfacesioc.Provide[T] validates return type at registration timelog/slog adapter support: Integrate with Go's structured loggingRequires Go 1.21+.
go get github.com/go-kid/ioc
package main
import (
"fmt"
"github.com/go-kid/ioc"
)
// Component to be injected
type ComponentA struct {
Name string
}
func (a *ComponentA) GetName() string {
return a.Name
}
// Target struct that depends on ComponentA
type App struct {
ComponentA *ComponentA `wire:""` // pointer + exported field + wire tag
}
func main() {
a := new(App)
// Register components
ioc.Register(a)
ioc.Register(&ComponentA{Name: "Comp-A"})
// Run the framework
_, err := ioc.Run()
if err != nil {
panic(err)
}
// Output: "Comp-A"
fmt.Println(a.ComponentA.GetName())
}
Key points: Dependency fields must be exported (start with uppercase) and use
wire:""to declare injection.
wire tag)Component injection is controlled via tag: wire:"<name>,arg1=xxx,arg2=yyy"
<name>: optional, inject by component name,arg=...: optional extra arguments (e.g., qualifier)wire:"" (empty) means inject by typetype Component struct {
Name string
}
type App struct {
C *Component `wire:""` // injected by *Component type
}
type IComponent interface {
GetName() string
}
type ComponentA struct{ Name string }
func (a *ComponentA) GetName() string { return a.Name }
type App struct {
C IComponent `wire:""` // inject by interface type
}
Implement NamingComponent interface to define component names:
type ComponentA struct {
Name string
componentName string
}
func (a *ComponentA) Naming() string { return a.componentName }
type App struct {
ByName IComponent `wire:"comp-A"` // inject by component name
}
When an interface has multiple implementations, the container selects by priority:
WirePrimary interface (primary)Naming())Using Primary marker:
type ComponentA struct {
Name string
definition.WirePrimaryComponent // embed Primary component
}
Using Qualifier:
type ComponentA struct {
qualifier string
}
func (a *ComponentA) Qualifier() string { return a.qualifier }
type App struct {
C IComponent `wire:",qualifier=comp-A"` // use qualifier
}
type App struct {
All []Interface `wire:""` // all Interface implementations
}
prefix: Bind Config Prefixtype configA struct {
B int `yaml:"b"`
C []int `yaml:"c"`
}
type App struct {
A *configA `prefix:"a"` // bind config prefix "a"
}
Configuration (YAML):
a:
b: 123
c: [1,2,3,4]
value: Literals / Placeholders / Expressionstype T struct {
DSN string `value:"${db.dsn}"` // config placeholder
Sum int `value:"#{1+2}"` // expression
Str string `value:"foo"` // literal
}
prop: Sugar for valuetype DBConfig struct {
DSN string `prop:"db.dsn"` // equivalent to value:"${db.dsn}"
}
${...}: Configuration placeholder, reads value from config#{...}: Expression evaluation, supports arithmetic, logical, conditional, collection operationsExample:
npx claudepluginhub go-kid/ioc --plugin iocAI Agent Skills for production-ready Go projects
20 modular skills for idiomatic Go — each under 225 lines, backed by 48 reference files, 8 automation scripts (all with --json, --limit, --force), and 4 asset templates. Covers error handling, naming, testing, concurrency, interfaces, generics, documentation, logging, performance, and more. Activates automatically with progressive disclosure and conditional cross-references.
Go code review and development skills covering architecture, middleware, data persistence, concurrency, and framework-specific patterns for BubbleTea, Wish SSH, and Prometheus.
Master Go 1.25+ development with modern patterns, advanced concurrency, performance optimization, and production-ready microservices. Skills: golangci-lint, goreleaser, go-tool (Go 1.24+ tool dependencies), go-blackbox (black box test enforcement), go-structure (project layout), GitHub Actions, GitLab CI. MCP: context7
Go development following Google Go style guide with Go 1.25+ features and best practices
gopilot is your Go copilot - a skill for writing idiomatic Go code, covering design patterns, error handling, testing, concurrency, generics, and stdlib patterns up to Go 1.26.