checkdeps
checkdeps is check pkg dependencies
examples
The error is caught because the usecase should not depend on the controller.
dependencies rule
controller -> usecase -> domain/repository(interface),domain/model <- repository(struct)
go file
package usecase
import (
"a4/domain/model"
"a4/repository" // want "error: found bug in dependency import"
)
type A struct {
repo repository.A
}
var _ *model.A = (*model.A)(nil)
install
go install github.com/mahiro72/checkdeps/cmd/checkdeps@latest
Useage
go vet -vettool=`which checkdeps` pkgname