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)