• Rob Pike's avatar
    cmd/doc: fix pretty printing of paths · 0722a5e7
    Rob Pike authored
    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: 's avatarAndrew Gerrand <adg@golang.org>
    0722a5e7
main.go 9.62 KB