]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: avoid calling token.IsExported on non-tokens
authorBryan C. Mills <bcmills@google.com>
Thu, 31 Oct 2019 03:52:04 +0000 (23:52 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 6 Nov 2019 14:33:39 +0000 (14:33 +0000)
commitf891b7c3425621d0ec3771144182507c90a80cff
tree771f24db6d63cdcc3ad73b78a1d9afcc392f0e6b
parent6dc250f456e078b213cee0f1099e915aa0d4d4d9
cmd/doc: avoid calling token.IsExported on non-tokens

token.IsExported expects to be passed a token, and does not check for
non-token arguments such as "C:\workdir\go\src\text".

While we're at it, clean up a few other parts of the code that
are assuming a package path where a directory may be passed instead.
There are probably others lurking around here, but I believe this
change is sufficient to get past the test failures on the
windows-amd64-longtest builder.

Fixes #35236

Change-Id: Ic79fa035531ca0777f64b1446c2f9237397b1bdf
Reviewed-on: https://go-review.googlesource.com/c/go/+/204442
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
src/cmd/doc/main.go