diff --git a/util/imports.go b/util/imports.go index df36272..d501362 100644 --- a/util/imports.go +++ b/util/imports.go @@ -49,7 +49,7 @@ type Import interface { GoImportPath() string // the import path used in .go files GoGetImportPath() string // the import path used by "go get" command GoModImportPath() string // the import path used by "go mod edit" command - IsLegacy() bool // an import is "legacy" if it does not have a relative import path + IsClassic() bool // an import is "classic" if it has no : character separator, hence no relative import path } type Imports []Import @@ -100,7 +100,7 @@ func (flogoImport *FlogoImport) GoModImportPath() string { } return flogoImport.modulePath + version } -func (flogoImport *FlogoImport) IsLegacy() bool { +func (flogoImport *FlogoImport) IsClassic() bool { return flogoImport.relativeImportPath == "" } diff --git a/util/mod.go b/util/mod.go index 1b3520d..f725de0 100644 --- a/util/mod.go +++ b/util/mod.go @@ -56,11 +56,11 @@ func (m *ModDepManager) AddDependency(flogoImport Import) error { err = ExecCmd(exec.Command("go", "mod", "download", flogoImport.ModulePath()), m.srcDir) if err != nil { - // if the resolution fails and the Flogo import is "legacy" + // if the resolution fails and the Flogo import is "classic" // (meaning it does not separate module path from Go import path): // 1. remove the import manually ("go mod edit -droprequire") would fail // 2. try with "go get" instead - if flogoImport.IsLegacy() { + if flogoImport.IsClassic() { m.RemoveImport(flogoImport) err = ExecCmd(exec.Command("go", "get", "-u", flogoImport.GoGetImportPath()), m.srcDir)