]> Cypherpunks repositories - gostls13.git/commit
testing: enable examples on js/wasm with non os.Pipe runExample
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Tue, 5 Mar 2019 11:58:37 +0000 (03:58 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 11 Mar 2019 18:59:53 +0000 (18:59 +0000)
commitac56baa09f789ab93dd97b31c4f033da7c85a6a4
tree586a92620ea83e7d5d2b78d3122d4cd33759ed56
parent48d3c32ba9c2cbe4cfded44a150540f15fdf517c
testing: enable examples on js/wasm with non os.Pipe runExample

os.Pipe is not implemented on wasm/js so for that purpose use
a temporary file for js/wasm. This change creates two versions
of runExample:

* runExample verbatim that still uses os.Pipe for non js/wasm
* runExample that uses a temporary file

Also added a TODO to re-unify these function versions back into
example.go wasm/js gets an os.Pipe implementation.

Change-Id: I9f418a49b2c397e1667724c7442b7bbe8942225e
Reviewed-on: https://go-review.googlesource.com/c/go/+/165357
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/testing/example.go
src/testing/run_example.go [new file with mode: 0644]
src/testing/run_example_js.go [new file with mode: 0644]