This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git
The following commit(s) were added to refs/heads/main by this push:
new 25edfc2 Fix optional dependencies are not excluded (#136)
25edfc2 is described below
commit 25edfc2fd8d52fb266653fb5f6c42da633d85c07
Author: kezhenxu94 <[email protected]>
AuthorDate: Wed Sep 7 23:06:03 2022 +0800
Fix optional dependencies are not excluded (#136)
---
pkg/deps/maven.go | 2 +-
pkg/deps/maven_test.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/deps/maven.go b/pkg/deps/maven.go
index 7220823..513df3d 100644
--- a/pkg/deps/maven.go
+++ b/pkg/deps/maven.go
@@ -320,7 +320,7 @@ func LoadDependenciesTree(data []byte) []*Dependency {
stack := []Elem{}
unique := make(map[string]struct{})
- reFind := regexp.MustCompile(`(?im)^.*? ([| ]*)(\+-|\\-)
(?P<gid>\b.+?):(?P<aid>\b.+?):(?P<packaging>\b.+)(:\b.+)?:(?P<version>\b.+):(?P<scope>\b.+?)$`)
//nolint:lll // can't break down regex
+ reFind := regexp.MustCompile(`(?im)^.*? ([| ]*)(\+-|\\-)
(?P<gid>\b.+?):(?P<aid>\b.+?):(?P<packaging>\b.+)(:\b.+)?:(?P<version>\b.+):(?P<scope>\b.+?)(?P<optional>\b.+?)?$`)
//nolint:lll // can't break down regex
rawDeps := reFind.FindAllSubmatch(data, -1)
deps := make([]*Dependency, 0, len(rawDeps))
diff --git a/pkg/deps/maven_test.go b/pkg/deps/maven_test.go
index c1f190c..6a835bb 100644
--- a/pkg/deps/maven_test.go
+++ b/pkg/deps/maven_test.go
@@ -49,7 +49,7 @@ func TestCanResolvePomFile(t *testing.T) {
}
func writeFile(fileName, content string) error {
- file, err := os.OpenFile(fileName, os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
0666)
+ file, err := os.OpenFile(fileName, os.O_WRONLY|os.O_TRUNC|os.O_CREATE,
0777)
if err != nil {
return err
}