5
poobar
1y

> As a developer in the Go world, I would recommend you to embrace idiomatic Go patterns and avoid dependency injection.

google literally created a DI lib for go.

Comments
  • 2
    What?
    I know only the limited plugin system, the module that uses sockets to communicate between processes and the wasm stuff.
  • 3
    Where did you read that? I've never heard such nonsense. Interfaces are basically designed to help injection. Go heavily leans on interfaces.

    A lot of times using an injection framework is overkill and makes things less obvious. In go we like things obvious. So if does not make the code a lot more readable than I would say don't use a framework (but please do always write clean code).
  • 2
  • 1
    @poobar well here is literally how the ranking pipeline works at Reddit. It when takes an argument called dependencies...

    https://youtu.be/TNyoKBLxfTM (screenshot is from around 24 min in the talk)
Add Comment