about summary refs log tree commit diff
path: root/nix/buildGo
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2020-06-03T03·42+0000
committeredef <edef@edef.eu>2020-06-13T03·04+0000
commit01ddbb43974afd3fd4e40db2677b03c7a544a11b (patch)
tree60910b8178cd1a43d9cbe45a84649c051ecc866e /nix/buildGo
parente09c4a0ae8aef9163296b4a5340a3b9ff7e26c34 (diff)
fix(nix/buildGo/external): Properly match import path prefixes r/928
Prior to this patch, github.com/hashicorp/terraform-svchost is
erroneously considered a sub-package of github.com/hashicorp/terraform,
breaking dependency searching:

    error: missing local dependency 'github.com.hashicorp.terraform-svchost' in 'github.com/hashicorp/terraform'

Change-Id: Ibcf0f3a9b1742ce46f84cbbf84e90127b8c1df0d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/122
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'nix/buildGo')
-rw-r--r--nix/buildGo/external/main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/nix/buildGo/external/main.go b/nix/buildGo/external/main.go
index b89fea7323..50c6c85895 100644
--- a/nix/buildGo/external/main.go
+++ b/nix/buildGo/external/main.go
@@ -97,7 +97,7 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
 
 		if i == importpath {
 			local = append(local, []string{})
-		} else if strings.HasPrefix(i, importpath) {
+		} else if strings.HasPrefix(i, importpath+"/") {
 			local = append(local, strings.Split(strings.TrimPrefix(i, importpath+"/"), "/"))
 		} else {
 			foreign = append(foreign, i)