Add profile loading and process execution

This commit is contained in:
2026-10-05 17:25:11 +00:00
parent 22a3dfe9bc
commit be225cf634
14 changed files with 575 additions and 12 deletions

View File

@@ -108,7 +108,7 @@ func checkImportDirections(packages []listedPackage) error {
var violations []string
for _, pkg := range packages {
if !strings.HasPrefix(pkg.ImportPath, modulePath+"/internal/") {
if !isInternalPackage(pkg.ImportPath) {
continue
}
for _, imported := range pkg.Imports {
@@ -149,6 +149,11 @@ func checkImportDirections(packages []listedPackage) error {
return errors.New(strings.Join(violations, "\n"))
}
func isInternalPackage(path string) bool {
return strings.HasPrefix(path, modulePath+"/internal/") ||
strings.HasPrefix(path, modulePath+"/") && strings.Contains(strings.TrimPrefix(path, modulePath), "/internal/")
}
func forbiddenRuntimeDependency(path string) bool {
for _, part := range strings.Split(strings.ToLower(path), "/") {
switch part {