]> Cypherpunks repositories - gostls13.git/commit
go/doc: handle generic receiver strings
authorJonathan Amsterdam <jba@google.com>
Sat, 18 Dec 2021 12:28:16 +0000 (07:28 -0500)
committerJonathan Amsterdam <jba@google.com>
Mon, 3 Jan 2022 23:45:12 +0000 (23:45 +0000)
commit95b240b2cd63e9631b3d0be72a10a3f2cc6f1d28
tree73ca8fbc3f25b9a82b1c15abbe8afc05939a2e52
parenta893d0f464e15f72d5f01937bed5011098adbb7b
go/doc: handle generic receiver strings

A receiver expression for a type with parameters may be an IndexExpr
or IndexListExpr in addition to an Ident or StarExpr. Add cases to
recvString to account for the new types.

Add tests that compare the fields of Func, and the fields of Type that
hold Funcs. These fields weren't previously tested.

Change-Id: Ia2cef51c85113422e0c5745c77dddcd53507ee51
Reviewed-on: https://go-review.googlesource.com/c/go/+/375095
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/go/doc/doc_test.go
src/go/doc/reader.go