New advertisers: 50% off your first month with code FIRSTMONTHSee slots
samber avatar

Golang Google Wire

Compile-time Go dependency injection with google/wire: explicit bindings, generated constructors, and build-tag injectors.

skills.sh installs
38.7K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers provider functions, wire.NewSet grouping, wire.Build injectors, cleanup functions, and interface binding with wire.Bind
  • Includes struct and value helpers (wire.Struct, wire.Value, wire.InterfaceValue, wire.FieldsOf) plus the wire ./... and wire check ./... commands
  • Enforces //go:build wireinject on injector files so stubs never reach the binary, and treats wire_gen.go as committed generated code
  • Designed for Go teams that want DI errors caught at build time rather than at runtime, not for reflection-based containers

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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:

Details

Repository
github.com/samber/cc-skills-golang
Category
Go
First seen
May 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Google Wire

More Go