go install github.com/elza2/go-cyclic@latest
# path 路径要设置为 go.mod 文件所在的路径.
# filter 过滤匹配的文件, 多个条件使用逗号隔开(,)
go-cyclic run --dir .path [--filter *_test.go]
git clone https://github.com/elza2/go-cyclic.git
# path 路径要设置为 go.mod 文件所在的路径.
go run ./main.go run --dir .path [--filter *_test.go]
# success output.
Success. Not circular dependence.
# failed output.
Failed. 1 circular dependence chains were found.
┌---→ app.go
┆ ↓
┆ routes.go
┆ ↓
└--- handler.go