DDD/Clean Architecture go linters

Origin (in Russian)

Tech talk (paid access only, unfortunately):
https://conf.ontico.ru/online/hl2023/details/5206668
Presentation:
https://docs.google.com/presentation/d/1n5jCie-9tBw3QEEF6NsNco4mS9xYkg52/edit#slide=id.g29c6e2d30cb_0_169

Linters

Dependencies between layers:
https://github.com/OpenPeeDeeP/depguard
https://github.com/fe3dback/go-arch-lint/

Others:
https://github.com/nishanths/exhaustive — to check using all microtypes in enums/switches.
https://github.com/go-simpler/musttag + https://github.com/maranqz/golangconf2023/blob/main/tags/rules.go — to prevent using struct tags in Domain models (Value Objects).
https://github.com/maranqz/gopublicfield — to prevent changing Value Objects (Domain models) from outside of the package.
https://github.com/GaijinEntertainment/go-exhaustruct — is useful for checking DB-Domain mappers to check all fields are initialized.

Similar Posts

LEAVE A COMMENT