From bb926f396a6e756bad2e0d7e35a31ab539477012 Mon Sep 17 00:00:00 2001 From: "notzippy@gmail.com" Date: Sat, 5 Mar 2022 09:10:51 -0800 Subject: [PATCH] Added additional pattern to test against Another different missing pacakge error thrown that can be detected and added This error occurs because a package may have been stripped down when originally loaded --- .vscode/load.sh | 1 + .vscode/load.web | 2 ++ harness/build.go | 5 +++++ 3 files changed, 8 insertions(+) create mode 100755 .vscode/load.sh create mode 100644 .vscode/load.web diff --git a/.vscode/load.sh b/.vscode/load.sh new file mode 100755 index 0000000..6a484dc --- /dev/null +++ b/.vscode/load.sh @@ -0,0 +1 @@ +http_load -rate 5 -seconds 10 load.web diff --git a/.vscode/load.web b/.vscode/load.web new file mode 100644 index 0000000..41d8a3d --- /dev/null +++ b/.vscode/load.web @@ -0,0 +1,2 @@ +http://localhost:9000/ +http://localhost:9000/miss diff --git a/harness/build.go b/harness/build.go index ff8009e..2d9f564 100644 --- a/harness/build.go +++ b/harness/build.go @@ -26,6 +26,7 @@ import ( var importErrorPattern = regexp.MustCompile("cannot find package \"([^\"]+)\"") var importErrorPattern2 = regexp.MustCompile("no required module provides package ([^;]+)+") +var addPackagePattern = regexp.MustCompile(`to add:\n\tgo get (.*)\n`) type ByString []*model.TypeInfo @@ -214,6 +215,10 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err if matches == nil { matches = importErrorPattern2.FindAllStringSubmatch(stOutput, -1) } + if matches == nil { + matches = addPackagePattern.FindAllStringSubmatch(stOutput, -1) + + } utils.Logger.Info("Build failed checking for missing imports", "message", stOutput, "missing_imports", len(matches)) if matches == nil { utils.Logger.Info("Build failed no missing imports", "message", stOutput)