#19 Initialize load.Mod* variables in ListPackage...
Closed 9 months ago by qulogic. Opened 11 months ago by eclipseo.
eclipseo/golist master  into  master

file modified
+10

@@ -183,6 +183,9 @@ 

  			if strings.Contains(err.Error(), "no Go files in") {

  				return nil

  			}

+ 			if strings.Contains(err.Error(), "cannot find module providing package") {

+ 				return nil

+ 			}

  			// TODO(jchaloup): remove later

  			if strings.Contains(err.Error(), "build constraints exclude all Go files in") {

  				return nil

@@ -417,6 +420,13 @@ 

  	// TODO(jchaloup): more things need to be init most likely

  	work.BuildInit()

  	load.ModInit = modload.Init

+ 	load.ModImportPaths = modload.ImportPaths

+ 	load.ModBinDir = modload.BinDir

+ 	load.ModLookup = modload.Lookup

+ 	load.ModDirImportPath = modload.DirImportPath

+ 	load.ModPackageModuleInfo = modload.PackageModuleInfo

+ 	load.ModPackageBuildInfo = modload.PackageBuildInfo

+ 	load.ModImportFromFiles = modload.ImportFromFiles

  	d := load.PackagesAndErrors([]string{path})

  	if d == nil {

  		return nil, fmt.Errorf("No package listing found for %v", path)

and return nil in CollectPackageInfos if the module does not exist
Fix #7.

Signed-off-by: Robert-André Mauchin zebob.m@gmail.com

Pull-Request has been closed by qulogic

9 months ago

Closing since the PR removing usage of all these internals has been merged.

Metadata