mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-18 13:25:06 +00:00
Updated shared build environments
Updated check for errors. Updated go.mod Added .vscode launch
This commit is contained in:
@@ -237,7 +237,7 @@ func (c *CommandConfig) InitPackageResolver() {
|
||||
var getCmd *exec.Cmd
|
||||
print("Downloading related packages ...")
|
||||
if c.Vendored {
|
||||
getCmd = exec.Command(c.GoCmd, "mod", "tidy")
|
||||
getCmd = exec.Command(c.GoCmd, "mod", "tidy", "-v")
|
||||
} else {
|
||||
utils.Logger.Info("No vendor folder detected, not using dependency manager to import package", "package", pkgName)
|
||||
getCmd = exec.Command(c.GoCmd, "get", "-u", pkgName)
|
||||
|
||||
@@ -273,12 +273,11 @@ func (rp *RevelContainer) ResolveImportPath(importPath string) (string, error) {
|
||||
return filepath.Join(rp.SourcePath, importPath), nil
|
||||
}
|
||||
config := &packages.Config{
|
||||
// TODO: packages.LoadSyntax deprecated, Need instead
|
||||
//nolint:staticcheck
|
||||
Mode: packages.LoadSyntax,
|
||||
Dir: rp.AppPath,
|
||||
Mode: packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports |
|
||||
packages.NeedTypes | packages.NeedTypesSizes | packages.NeedSyntax | packages.NeedTypesInfo,
|
||||
Dir: rp.AppPath,
|
||||
}
|
||||
|
||||
config.Env = utils.ReducedEnv(false)
|
||||
pkgs, err := packages.Load(config, importPath)
|
||||
if len(pkgs) == 0 {
|
||||
return "", errors.New("No packages found for import " + importPath + " using app path " + rp.AppPath)
|
||||
|
||||
Reference in New Issue
Block a user