Updated shared build environments

Updated check for errors.
Updated go.mod
Added .vscode launch
This commit is contained in:
notzippy@gmail.com
2022-02-20 17:16:12 -08:00
parent b562bd2dc5
commit ea5acb720f
10 changed files with 125 additions and 52 deletions

View File

@@ -25,6 +25,7 @@ import (
)
var importErrorPattern = regexp.MustCompile("cannot find package \"([^\"]+)\"")
var importErrorPattern2 = regexp.MustCompile("no required module provides package ([^;]+)+")
type ByString []*model.TypeInfo
@@ -210,6 +211,9 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err
// See if it was an import error that we can go get.
matches := importErrorPattern.FindAllStringSubmatch(stOutput, -1)
if matches == nil {
matches = importErrorPattern2.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)
@@ -226,6 +230,7 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (_ *App, err err
}
gotten[pkgName] = struct{}{}
if err := c.PackageResolver(pkgName); err != nil {
panic("failed to resolve")
utils.Logger.Error("Unable to resolve package", "package", pkgName, "error", err)
return nil, newCompileError(paths, []byte(err.Error()))
}