]> Cypherpunks repositories - gostls13.git/commit
go/doc: inspect function signature for building playground examples
authorYury Smolsky <yury@smolsky.by>
Tue, 30 Oct 2018 22:19:35 +0000 (00:19 +0200)
committerRobert Griesemer <gri@golang.org>
Mon, 5 Nov 2018 22:36:24 +0000 (22:36 +0000)
commitf1a9f1df5070f69685e269de940c6218f899d228
treeb0439bb79c1f3edbff8a6174bb9f380785322ab0
parenta540aa338a3145ab32ca4409919c82722f8724f3
go/doc: inspect function signature for building playground examples

This documentation example was broken:
https://golang.org/pkg/image/png/#example_Decode.
It did not have the "io" package imported,
The package was referenced in the result type of the function.

The "playExample" function did not inspect
the result types of declared functions.

This CL adds inspecting of parameters and result types of functions.

Fixes #28492
Updates #9679

Change-Id: I6d8b11bad2db8ea8ba69039cfaa914093bdd5132
Reviewed-on: https://go-review.googlesource.com/c/146118
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/doc/example.go
src/go/doc/example_test.go