You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
crate/wireexample/cmd/example_01/wire.go

21 lines
370 B
Go

2 years ago
//go:build wireinject
package main
import "github.com/google/wire"
// Approach A
func InjectGuessWithoutMock(rander Rander) *Guess {
panic(wire.Build(GuessProviderSetWithoutMock))
}
// Approach B
func InjectRealGuess() *Guess {
panic(wire.Build(GuessProviderSet))
}
// Approach B
func InjectMockGuess() *GuessWithMock {
panic(wire.Build(MockGuessProviderSet))
}