From 7a2baa9c48601e65bc8c8ed99d57a0d214b779ef Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 7 Nov 2019 13:57:19 +1100 Subject: [PATCH] cmd/doc: don't bother checking validity of symbols at top level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/+/205778 Reviewed-by: Caleb Spare Reviewed-by: Daniel Martí Run-TryBot: Daniel Martí --- src/cmd/doc/main.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/cmd/doc/main.go b/src/cmd/doc/main.go index 43144d9f221..86259e5f1f7 100644 --- a/src/cmd/doc/main.go +++ b/src/cmd/doc/main.go @@ -358,17 +358,11 @@ func parseSymbol(str string) (symbol, method string) { case 1: case 2: method = elem[1] - if !token.IsIdentifier(method) { - log.Fatalf("invalid identifier %q", method) - } default: log.Printf("too many periods in symbol specification") usage() } symbol = elem[0] - if !token.IsIdentifier(symbol) { - log.Fatalf("invalid identifier %q", symbol) - } return }