From b392a2d072c66916b8f7df034a5ea0dfd663c2d9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 9 Mar 2018 12:21:00 +0100 Subject: [PATCH] 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 --- bind/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind/types.go b/bind/types.go index ded3ccf..e7a7fce 100644 --- a/bind/types.go +++ b/bind/types.go @@ -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] }