]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: make local dot-slash path names work
authorRob Pike <r@golang.org>
Mon, 5 Mar 2018 05:21:44 +0000 (16:21 +1100)
committerRob Pike <r@golang.org>
Tue, 6 Mar 2018 01:11:26 +0000 (01:11 +0000)
commitbaf3eb1625d64d42d7eacd7d29ad6d1e682553a0
tree6e00abb294f44365b7ba12d392f16e058c943c9d
parent917e72697e653a9a3be3325e6640e50d2098aa5b
cmd/doc: make local dot-slash path names work

Before, an argument that started ./ or ../ was not treated as
a package relative to the current directory. Thus

$ cd $GOROOT/src/text
$ go doc ./template

could find html/template as $GOROOT/src/html/./template
is a valid Go source directory.

Fix this by catching such paths and making them absolute before
processing.

Fixes #23383.

Change-Id: Ic2a92eaa3a6328f728635657f9de72ac3ee82afb
Reviewed-on: https://go-review.googlesource.com/98396
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/doc/doc_test.go
src/cmd/doc/main.go