]> Cypherpunks repositories - gostls13.git/commitdiff
go/doc: use strings.TrimPrefix
authorcuiweixie <cuiweixie@gmail.com>
Thu, 29 Sep 2022 13:37:25 +0000 (21:37 +0800)
committerGopher Robot <gobot@golang.org>
Fri, 30 Sep 2022 14:12:38 +0000 (14:12 +0000)
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>

src/go/doc/comment/parse.go

index e8d844c4915e5168f1103b6e8bf7c743f29ed5df..62a0f8f2bb8e92aeb97d38f0afdb7821154bf3a3 100644 (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 {