Go module and workspace discovery
Architecture testing for Go
ArchUnitGo
Write the sentence your team already says aloud and let go test show where the code disagrees. ArchUnitGo covers files, layers, slices, metrics, and dependency graphs with structured violations and no special runner.
Go module
go get github.com/LukasNiessen/ArchUnitGopackage architecture_test
import (
"testing"
archunit "github.com/LukasNiessen/ArchUnitGo"
)
func TestApiDoesNotTouchDatabase(t *testing.T) {
rule := archunit.ProjectFiles(nil).
InFolder("internal/api/**").
ShouldNot().DependOnFiles().
InFolder("internal/db/**")
archunit.AssertPasses(t, rule, nil)
}Capabilities
What ArchUnitGo brings to the test suite.
The family shares a recognizable architecture vocabulary while each implementation stays honest about its language, toolchain, and maturity.
File, named-layer, and slice rules
Counting and dependency metrics
Structured violations with test helpers
Graph snapshots and HTML reports
Glob, regex, and exclusion semantics
Current maturity
Main-branch preview
Functional on main with no tagged release yet; installation resolves to a pseudo-version and APIs may move.
Where it fits
Put boundaries next to the code they protect.
Common starting points for ArchUnitGo include the following project shapes.
More ecosystems
The same intent, expressed natively.
Explore sibling implementations and carry the architecture vocabulary across a polyglot system.
Make the first boundary executable.
Add one meaningful rule, run it with the existing tests, and grow the architecture suite as the system reveals where it needs protection.
Start with ArchUnitGo ↗