go/doc: use strings.TrimPrefix

Change-Id: Ie1e76d2e99bf2af7f064c9073c1fb866086962f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/436715
Run-TryBot: Robert Griesemer <gri@google.com>
Run-TryBot: xie cui <523516579@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
cuiweixie 2022-09-29 21:37:25 +08:00 committed by Gopher Robot
parent 9910f8a403
commit 7aa4905bb4

View file

@ -851,9 +851,7 @@ func (d *parseDoc) docLink(text, before, after string) (link *DocLink, ok bool)
return nil, false
}
}
if strings.HasPrefix(text, "*") {
text = text[1:]
}
text = strings.TrimPrefix(text, "*")
pkg, name, ok := splitDocName(text)
var recv string
if ok {