mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
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:
1
.vscode/load.sh
vendored
Executable file
1
.vscode/load.sh
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
http_load -rate 5 -seconds 10 load.web
|
||||||
2
.vscode/load.web
vendored
Normal file
2
.vscode/load.web
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
http://localhost:9000/
|
||||||
|
http://localhost:9000/miss
|
||||||
@@ -26,6 +26,7 @@ import (
|
|||||||
|
|
||||||
var importErrorPattern = regexp.MustCompile("cannot find package \"([^\"]+)\"")
|
var importErrorPattern = regexp.MustCompile("cannot find package \"([^\"]+)\"")
|
||||||
var importErrorPattern2 = regexp.MustCompile("no required module provides package ([^;]+)+")
|
var importErrorPattern2 = regexp.MustCompile("no required module provides package ([^;]+)+")
|
||||||
|
var addPackagePattern = regexp.MustCompile(`to add:\n\tgo get (.*)\n`)
|
||||||
|
|
||||||
type ByString []*model.TypeInfo
|
type ByString []*model.TypeInfo
|
||||||
|
|
||||||
@@ -214,6 +215,10 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err
|
|||||||
if matches == nil {
|
if matches == nil {
|
||||||
matches = importErrorPattern2.FindAllStringSubmatch(stOutput, -1)
|
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))
|
utils.Logger.Info("Build failed checking for missing imports", "message", stOutput, "missing_imports", len(matches))
|
||||||
if matches == nil {
|
if matches == nil {
|
||||||
utils.Logger.Info("Build failed no missing imports", "message", stOutput)
|
utils.Logger.Info("Build failed no missing imports", "message", stOutput)
|
||||||
|
|||||||
Reference in New Issue
Block a user