const rulesFileName …
const goModFile …
func main() { … }
func loadPkgs(patterns ...string) ([]*packages.Package, error) { … }
func massage(in []*packages.Package) []*packages.Package { … }
func unmassage(str string) string { … }
type ImportBoss …
func newBoss(pkgs []*packages.Package) *ImportBoss { … }
func hasTestFiles(files []string) bool { … }
func (boss *ImportBoss) Verify(pkg *packages.Package) []error { … }
func packageDir(pkg *packages.Package) string { … }
type FileFormat …
type Rule …
type Disposition …
const DepForbidden …
const DepAllowed …
const DepUnknown …
func (r Rule) Evaluate(imp string) Disposition { … }
func recursiveRead(path string) ([]*FileFormat, error) { … }
func readFile(path string) (*FileFormat, error) { … }
func isGoModRoot(path string) bool { … }
func removeLastDir(path string) (newPath, removedDir string) { … }
func (boss *ImportBoss) verifyRules(pkg *packages.Package, restrictionFiles []*FileFormat) []error { … }
func uniq(slices ...[]string) []string { … }
func hasPathPrefix(path, prefix string) bool { … }
func transitiveImports(pkg *packages.Package) ([]string, []string) { … }
func dfsImports(dest *[]string, seen map[string]bool, p *packages.Package) { … }
func (boss *ImportBoss) verifyInverseRules(pkg *packages.Package, restrictionFiles []*FileFormat) []error { … }
func transitiveClosure(in map[string][]string) map[string][]string { … }