feat: roles system backend
This commit is contained in:
1 parent
44cca46d5e
commit
8c6c6456da
50 files changed
+2578
-22
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRoleDomainImportsOnlyTheStandardLibrary(t *testing.T) {
|
||||
t.Run("The role domain imports only the standard library", func(t *testing.T) {
|
||||
files, err := filepath.Glob("../internal/domain/role/*.go")
|
||||
if err != nil || len(files) == 0 {
|
||||
t.Fatalf("no role domain files: %v", err)
|
||||
}
|
||||
for _, file := range files {
|
||||
relative := strings.TrimPrefix(filepath.ToSlash(file), "../")
|
||||
for _, imported := range importsOf(t, relative) {
|
||||
first := strings.Split(imported, "/")[0]
|
||||
if strings.Contains(first, ".") || first == "RenewCMS" {
|
||||
t.Errorf("%s imports %s", relative, imported)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user