Go dependency injection tool Wire

Read directlyhttps://github.com/google/wire?tab=readme-ov-filearrow-up-rightthe tutorial section

If interfaces are used, there are two ways to adapt wire:

  1. NewXX methods return an interface instead of returning a concrete struct implementation; this style is not encouraged in Go

  2. Use wire.Bind method

Using the bind method:

https://github.com/google/wire/blob/main/docs/guide.md#binding-interfacesarrow-up-right

Last updated