fix(nix/buildGo/external): Properly match import path prefixes
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>
This commit is contained in:
parent
e09c4a0ae8
commit
01ddbb4397
1 changed files with 1 additions and 1 deletions
2
nix/buildGo/external/main.go
vendored
2
nix/buildGo/external/main.go
vendored
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue