aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/requestwrite_test.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2020-08-20 11:35:17 -0400
committerJonathan Amsterdam <jba@google.com>2020-08-21 20:27:53 +0000
commit5d7261870e73f10c90c903a329eeb99b151d9f9f (patch)
treee353cbaa4d0851774d1ca665168d5659c89acd41 /src/net/http/requestwrite_test.go
parent9679b307334bce77cc6e50751956a4c717e9458c (diff)
downloadgo-5d7261870e73f10c90c903a329eeb99b151d9f9f.tar.xz
go/doc: support examples on methods from embedded unexported types
In type T1 struct { t2 } type t2 int func (t2) M() T1 has method M because it embeds t2, which has M. Classify the example func ExampleT1_M with T1 instead of ignoring it, as is done currently. There is no other way to provide an example for such a method, since its original type is unexported. Continue to ignore examples on methods from embedded types that are exported, unless in AllMethods mode. Examples for those methods could be written on the original type. The change involves removing a check in classifyExamples. The check isn't necessary to get the above behavior because reader.collectEmbeddedMethods and sortedFuncs already generate the appropriate list of methods. For #40172. Change-Id: Ibe7d965ecba6426466184e6e6655fc05989e9caf Reviewed-on: https://go-review.googlesource.com/c/go/+/249557 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/net/http/requestwrite_test.go')
0 files changed, 0 insertions, 0 deletions