Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cleanarch/cleanarch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func TestValidator_Validate(t *testing.T) {
IsValid: true,
IgnoredPackages: []string{"github.com/roblaszczak/go-cleanarch/examples/ignore-package/app"},
},
{Path: "../examples/external-module/moduleA", IsValid: true},
}

for _, c := range testCases {
Expand Down
3 changes: 3 additions & 0 deletions examples/external-module/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# External module imports

moduleA imports from external Go module moduleB with same layer name.
5 changes: 5 additions & 0 deletions examples/external-module/moduleA/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/external/moduleA

go 1.21

replace github.com/external/moduleB => ../moduleB
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package application

import (
"github.com/external/moduleB/application"
)

func Handle() error {
return application.ErrNotFound
}
5 changes: 5 additions & 0 deletions examples/external-module/moduleB/application/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package application

import "errors"

var ErrNotFound = errors.New("not found")
3 changes: 3 additions & 0 deletions examples/external-module/moduleB/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/external/moduleB

go 1.21