#35 Restrict package path comparison for skip self
Opened 6 months ago by jackyzy823. Modified 6 months ago
jackyzy823/golist issue34  into  master

file modified
+1 -1
@@ -327,7 +327,7 @@ 

  	var pkgs []string

  

  	for relPath := range imports {

- 		if skipSelf && strings.HasPrefix(relPath, p.packagePath) {

+ 		if skipSelf && strings.HasPrefix(relPath, p.packagePath+"/") {

  			continue

  		}

  

Fix for issue 34


I also encounter this problem when packaging gopass, it depends on "github.com/gopasspw/gopass-hibp/pkg/hibp/api" in github.com/gopasspw/gopass/internal/audit/audit.go , but golist do not generate requires for it .Because "github.com/gopasspw/gopass-hibp" has same prefix with "github.com/gopasspw/gopass".

So we must add a "/" to "github.com/gopasspw/gopass" to prevent the path comparison problem.

Metadata