]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: fix pretty printing of paths
authorRob Pike <r@golang.org>
Mon, 28 Sep 2015 20:45:57 +0000 (13:45 -0700)
committerRob Pike <r@golang.org>
Tue, 29 Sep 2015 02:18:57 +0000 (02:18 +0000)
commit0722a5e71848f62363f71eac4696469cea754b83
treeb4aa29ddf3332468380a5ce15fb92db70481ff6c
parent3b9e8bb7f214db90fb116d25d67161e7fb932d75
cmd/doc: fix pretty printing of paths

The code to strip GOROOT and GOPATH had a bug: it assumed there
were bytes after the GOROOT prefix but there might not be.
Fix this and other issues by taking care the prefix is really a
file name prefix for the path, not just a string prefix, and
handle the case where GOROOT==path.

Change-Id: I8066865fd05f938bb6dbf3bb8ab1fc58e5cf6bb5
Reviewed-on: https://go-review.googlesource.com/15112
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/cmd/doc/doc_test.go
src/cmd/doc/main.go
src/cmd/doc/pkg.go