samber avatar

Golang Google Wire

Google Wire does compile-time dependency injection for Go through code generation instead of runtime reflection. You write providers (regular Go functions), group them into sets with wire.NewSet, then declare an injector function tagged with //go:build wireinject. Running wire generates wire_gen.go with plain constructor calls, so missing dependencies fail at codegen, not when your app boots. Interface bindings must be explicit via wire.Bind, which prevents ambiguity when multiple types satisfy the same interface. The project was archived in August 2025 as feature-complete. Good fit if you want compile-time safety and zero runtime overhead; use dig or fx instead if you need lifecycle hooks or lazy initialization.

skills.sh installs
38.3K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-google-wire --agent claude-code

Installs into .claude/skills of the current project.

Files

Persona: You are a Go architect using wire for compile-time DI. You let the compiler catch missing dependencies, treat wire_gen.go as committed source, and re-run wire ./... after every graph change.

Dependencies:

  • wire: go install github.com/google/wire/cmd/wire@latest

Using google/wire for Compile-Time Dependency Injection in Go

Code-generation DI toolkit. Wire resolves the dependency graph at compile time and emits plain Go constructor calls — no runtime container, no reflection. Errors appear when you run wire ./..., not at first request.

Note: google/wire was archived in August 2025 (feature-complete; bug fixes still accepted).

Official Resources: pkg.go.dev · github.com/google/wire · User Guide · Best Practices

This skill is not exhaustive — refer to library documentation and code examples for more information:

Sponsors

Details

Repository
github.com/samber/cc-skills-golang
Categories
DevOps & CI/CD, Git & Pull Requests, Go
First seen
May 16, 2026

More from samber/cc-skills-golang

All 47
1neondatabase avatarneon-postgres-branchesneondatabase/agent-skillsChoose and create the right Neon branch type for testing and development. Use when users ask about Neon branching, migration testing with real data, isolated te37.3Kskills.sh installs
2expo avatarexpo-native-uiexpo/skillsFramework (OSS). Build beautiful, native-feeling Expo screens. Covers Apple HIG styling, semantic colors, native controls, SF Symbols, media, animations, visual36.5Kskills.sh installs
3expo avatarexpo-uiexpo/skillsFramework (OSS). Build native UI with the @expo/ui package: real SwiftUI on iOS and Jetpack Compose on Android rendered from React in an Expo or React Native ap35.9Kskills.sh installs
4firecrawl avatarfirecrawl-website-design-clonefirecrawl/firecrawl-workflowsExtract any website's design system into an agent-ready DESIGN.md using Firecrawl scrape evidence. Use when the user wants colors, fonts, spacing, components, l33.5Kskills.sh installs
5mcp-use avatarmcp-apps-buildermcp-use/mcp-useBuild, modify, debug, migrate, or review TypeScript MCP servers and interactive MCP Apps using mcp-use v2. Use for tools, resources, prompts, Views, React host 33.1Kskills.sh installs
6firecrawl avatarfirecrawl-knowledge-basefirecrawl/firecrawl-workflowsBuild a knowledge base from web content with Firecrawl. Use for local reference docs, RAG-ready chunks, fine-tuning datasets, documentation mirrors, topic corpo32.9Kskills.sh installs