From 65a1569ec05f8b60ee2003a3782c57fa522ea670 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sun, 9 Jun 2019 10:40:09 +0200 Subject: [PATCH] Missing step from Go documentation should be repeated here for clarity. The 'goexec' command will not work unless this step has been completed. --- WebAssembly.asciidoc => WebAssembly.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename WebAssembly.asciidoc => WebAssembly.md (95%) diff --git a/WebAssembly.asciidoc b/WebAssembly.md similarity index 95% rename from WebAssembly.asciidoc rename to WebAssembly.md index 198b1df0..c1d99c94 100644 --- a/WebAssembly.asciidoc +++ b/WebAssembly.md @@ -93,14 +93,20 @@ https://github.com/shurcooL/goexec#goexec[`goexec`]: $ goexec 'http.ListenAndServe(":8080", http.FileServer(http.Dir(".")))' ``` -Or use your own https://play.golang.org/p/pZ1f5pICVbV[basic HTTP server command]. +Or use your own https://play.golang.org/p/pZ1f5pICVbV[basic HTTP server command]. + +Note: for the `goexec` command to work on Unix-like systems, you must [add the PATH environment variable](https://golang.org/doc/install#tarball) for Go to your shell's `profile`. Go's getting started guide explains this: +> Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile: + +> `export PATH=$PATH:/usr/local/go/bin` + +> Note: changes made to a profile file may not apply until the next time you log into your computer Finally, navigate to http://localhost:8080/index.html, open the JavaScript debug console, and you should see the output. You can modify the program, rebuild `main.wasm`, and refresh to see new output. - # Executing WebAssembly with Node.js It's possible to execute compiled WebAssembly modules using Node.js