2
0
mirror of synced 2025-02-22 14:28:14 +00:00

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-09 12:21:00 +01:00
parent 2f2872eacd
commit b392a2d072

View File

@ -161,7 +161,7 @@ func pkgFirstElem(p *types.Package) string {
path := p.Path() path := p.Path()
idx := strings.Index(path, "/") idx := strings.Index(path, "/")
if idx == -1 { if idx == -1 {
return "" return path
} }
return path[:idx] return path[:idx]
} }