fix(external): Fix "inverted" local dependencies
Usually in large packages the root depends on one or more sub-packages (or there is no root), but some projects (e.g. golang.org/x/oauth2) do it the other way around. This fix adds compatibility for both ways.
This commit is contained in:
parent
9d5417501b
commit
5649c75d01
1 changed files with 3 additions and 1 deletions
4
external/main.go
vendored
4
external/main.go
vendored
|
@ -89,7 +89,9 @@ func analysePackage(root, source, importpath string, stdlib map[string]bool) (pk
|
|||
continue
|
||||
}
|
||||
|
||||
if strings.HasPrefix(i, importpath) {
|
||||
if i == importpath {
|
||||
local = append(local, []string{})
|
||||
} 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