about summary refs log tree commit diff
path: root/external
diff options
context:
space:
mode:
Diffstat (limited to 'external')
-rw-r--r--external/main.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/external/main.go b/external/main.go
index 028703e38cad..aac966172b34 100644
--- a/external/main.go
+++ b/external/main.go
@@ -29,7 +29,8 @@ var stdlibList string
 // Return information includes the local (relative from project root)
 // and external (none-stdlib) dependencies of this package.
 type pkg struct {
-	Name        []string   `json:"name"`
+	Name        string     `json:"name"`
+	Locator     []string   `json:"locator"`
 	Files       []string   `json:"files"`
 	LocalDeps   [][]string `json:"localDeps"`
 	ForeignDeps []string   `json:"foreignDeps"`
@@ -95,12 +96,12 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
 
 	prefix := strings.TrimPrefix(source, root+"/")
 
-	name := []string{}
+	locator := []string{}
 	if len(prefix) != len(source) {
-		name = strings.Split(prefix, "/")
+		locator = strings.Split(prefix, "/")
 	} else {
-		// Otherwise, the name is empty since its the root package and no
-		// prefix should be added to files.
+		// Otherwise, the locator is empty since its the root package and
+		// no prefix should be added to files.
 		prefix = ""
 	}
 
@@ -110,7 +111,8 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
 	}
 
 	return pkg{
-		Name:        name,
+		Name:        path.Join(importpath, prefix),
+		Locator:     locator,
 		Files:       files,
 		LocalDeps:   local,
 		ForeignDeps: foreign,