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
This commit is contained in:
notzippy@gmail.com
2022-03-05 09:10:51 -08:00
parent 3cd5ebbde2
commit bb926f396a
3 changed files with 8 additions and 0 deletions

1
.vscode/load.sh vendored Executable file
View File

@@ -0,0 +1 @@
http_load -rate 5 -seconds 10 load.web

2
.vscode/load.web vendored Normal file
View File

@@ -0,0 +1,2 @@
http://localhost:9000/
http://localhost:9000/miss

View File

@@ -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)