]> Cypherpunks repositories - gostls13.git/commit
go/doc: make examples that depend on top-level decls playable
authorHiroshi Ioka <hirochachacha@gmail.com>
Wed, 13 Dec 2017 00:56:04 +0000 (09:56 +0900)
committerRobert Griesemer <gri@golang.org>
Wed, 27 Jun 2018 23:20:51 +0000 (23:20 +0000)
commit11f1fab4dfe59f09f322b6493a2b9c5d0ae99bfa
treec04060f5eaa1ed1c76863d13b9fb5515e1f80733
parent87867505c0dae0c9a9b3b93cc01ee8c5a30dc8bb
go/doc: make examples that depend on top-level decls playable

Currently, the following example cannot run in playground:

    func a() {
        fmt.Println("A")
    }

    func ExampleA() {
        a()
    }

This CL solves it.

Fixes #23095

Change-Id: I5a492ff886a743f20cb4ae646e8453bde9c5f0da
Reviewed-on: https://go-review.googlesource.com/83615
Run-TryBot: Robert Griesemer <gri@golang.org>
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
src/go/doc/reader.go