@@ -63,7 +63,7 @@ support file, and a HTML page to connect everything together.
63
63
Copy the JavaScript support file:
64
64
65
65
``` sh
66
- cp " $( go env GOROOT) /misc /wasm/wasm_exec.js" .
66
+ cp " $( go env GOROOT) /lib /wasm/wasm_exec.js" .
67
67
```
68
68
69
69
Create an ` index.html ` file:
@@ -120,12 +120,12 @@ rather than a browser, which can be useful for testing and automation.
120
120
121
121
First, make sure Node is installed and in your ` PATH ` .
122
122
123
- Then, add ` $(go env GOROOT)/misc /wasm ` to your ` PATH ` .
123
+ Then, add ` $(go env GOROOT)/lib /wasm ` to your ` PATH ` .
124
124
This will allow ` go run ` and ` go test ` find ` go_js_wasm_exec ` in a ` PATH ` search
125
125
and use it to just work for ` js/wasm ` :
126
126
127
127
``` console
128
- $ export PATH=" $PATH :$( go env GOROOT) /misc /wasm"
128
+ $ export PATH=" $PATH :$( go env GOROOT) /lib /wasm"
129
129
$ GOOS=js GOARCH=wasm go run .
130
130
Hello, WebAssembly!
131
131
$ GOOS=js GOARCH=wasm go test
@@ -137,15 +137,15 @@ If you're running working on Go itself, this will also allow you to run `run.bas
137
137
seamlessly.
138
138
139
139
` go_js_wasm_exec ` is a wrapper that allows running Go Wasm binaries in Node. By default,
140
- it may be found in the ` misc /wasm` directory of your Go installation.
140
+ it may be found in the ` lib /wasm` directory of your Go installation.
141
141
142
142
If you'd rather not add anything to your ` PATH ` , you may also set the ` -exec ` flag to
143
143
the location of ` go_js_wasm_exec ` when you execute ` go run ` or ` go test ` manually.
144
144
145
145
``` console
146
- $ GOOS=js GOARCH=wasm go run -exec=" $( go env GOROOT) /misc /wasm/go_js_wasm_exec" .
146
+ $ GOOS=js GOARCH=wasm go run -exec=" $( go env GOROOT) /lib /wasm/go_js_wasm_exec" .
147
147
Hello, WebAssembly!
148
- $ GOOS=js GOARCH=wasm go test -exec=" $( go env GOROOT) /misc /wasm/go_js_wasm_exec"
148
+ $ GOOS=js GOARCH=wasm go test -exec=" $( go env GOROOT) /lib /wasm/go_js_wasm_exec"
149
149
PASS
150
150
ok example.org/my/pkg 0.800s
151
151
```
@@ -154,10 +154,10 @@ Finally, the wrapper may also be used to directly execute a Go Wasm binary:
154
154
155
155
``` console
156
156
$ GOOS=js GOARCH=wasm go build -o mybin .
157
- $ $( go env GOROOT) /misc /wasm/go_js_wasm_exec ./mybin
157
+ $ $( go env GOROOT) /lib /wasm/go_js_wasm_exec ./mybin
158
158
Hello, WebAssembly!
159
159
$ GOOS=js GOARCH=wasm go test -c
160
- $ $( go env GOROOT) /misc /wasm/go_js_wasm_exec ./pkg.test
160
+ $ $( go env GOROOT) /lib /wasm/go_js_wasm_exec ./pkg.test
161
161
PASS
162
162
ok example.org/my/pkg 0.800s
163
163
```
0 commit comments