bind: handle import paths without trailing slashes correctly
If ever the gobind tool switches to a source importer (see CL 99777), make sure import paths are without trailing slashes are handled correctly. Change-Id: Ib3ce15f8dcd53dce09a5bb183e4013a5deba39b4 Reviewed-on: https://go-review.googlesource.com/99776 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
parent
2f2872eacd
commit
b392a2d072
@ -161,7 +161,7 @@ func pkgFirstElem(p *types.Package) string {
|
||||
path := p.Path()
|
||||
idx := strings.Index(path, "/")
|
||||
if idx == -1 {
|
||||
return ""
|
||||
return path
|
||||
}
|
||||
return path[:idx]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user