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:
Elias Naur
2018-03-21 12:14:32 +00:00
parent 2f2872eacd
commit b392a2d072
+1 -1
View File
@@ -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]
}