The Principal Dev โ€“ Masterclass for Tech Leads

The Principal Dev โ€“ Masterclass for Tech LeadsNov 27-28

Join

do - Dependency Injection

tag Go Version GoDoc Build Status Go report Coverage License

โš™๏ธ A dependency injection toolkit based on Go 1.18+ Generics.

This library implements the Dependency Injection design pattern. It may replace the fantastic uber/dig package. samber/do uses Go 1.18+ generics and therefore offers a typeโ€‘safe API.

image

See also:

Why this name?

I love the short name for such a utility library. This name is the sum of DI and Go and no Go package uses this name.

๐Ÿ’ก Features

๐Ÿš€ Install

# v2 (latest)
go get github.com/samber/do@v2

# v1
go get github.com/samber/do@v1.6.0

This library is v2 and follows SemVer strictly.

No breaking changes will be made to exported APIs before v3.0.0.

This library has no dependencies except the Go std lib.

๐Ÿ”ฅ Migration from v1 to v2

Documentation here

๐Ÿค  Documentation

๐ŸŽฌ Project boilerplate

๐Ÿค Contributing

Don't hesitate ;)

# Install some dev dependencies
make tools

# Run tests
make test
# or
make watch-test

๐Ÿ‘ค Contributors

Contributors

๐Ÿ’ซ Show your support

Give a โญ๏ธ if this project helped you!

GitHub Sponsors

๐Ÿ“ License

Copyright ยฉ 2022 Samuel Berthe.

This project is MIT licensed.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.