Commit 7a2baa9c authored by Rob Pike's avatar Rob Pike

cmd/doc: don't bother checking validity of symbols at top level

No need to check as pieces further down do so anyway:

	%  go doc '&&.%$^'
	doc: symbol && is not a type in package fmt installed in "fmt"
	exit status 1
	%

Removing this check allows 'go doc sort.interface' or 'go doc
types.type' to discover sort.Interface and go/types.Type.

Easily

Fixes #34656.

Change-Id: I84352e83dd7f91a232f45a44d1a52f019a1a9a06
Reviewed-on: https://go-review.googlesource.com/c/go/+/205778Reviewed-by: default avatarCaleb Spare <cespare@gmail.com>
Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
parent f5949b60
...@@ -358,17 +358,11 @@ func parseSymbol(str string) (symbol, method string) { ...@@ -358,17 +358,11 @@ func parseSymbol(str string) (symbol, method string) {
case 1: case 1:
case 2: case 2:
method = elem[1] method = elem[1]
if !token.IsIdentifier(method) {
log.Fatalf("invalid identifier %q", method)
}
default: default:
log.Printf("too many periods in symbol specification") log.Printf("too many periods in symbol specification")
usage() usage()
} }
symbol = elem[0] symbol = elem[0]
if !token.IsIdentifier(symbol) {
log.Fatalf("invalid identifier %q", symbol)
}
return return
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment