repositorypackage
0.0.0-20220607151324-6310ca47fc88
Repository: https://github.com/datosh/gau.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
gau
Golang ArchUnit (gau) Test Framework enables you to test your application's architecture using Go's build-in unit-testing capabilities.
An example rule could look like this:
func TestSimple(t *testing.T) {
Packages(t, "github.com/datosh/gau/tests/...").That().
ResideIn("github.com/datosh/gau/tests/dependona").
Should().DirectlyDependOn("github.com/datosh/gau/tests/a")
}
Credit
- Java ArchUnit
- matthewmcnew/archtest
- not maintained, slow for bigger projects
- fdaines/arch-go
- not unit test based: requires extra CLI tool
Ideas
- Support checking of not using specific functions / classes of packages, e.g., "do not use fmt.Prinln", but some logging library instead.
Open Problems
- Is Method Chaining really the best way for golang? How do we communicate errors? Fail on last call? Return nil?