In your WASM-XHR example at https://github.com/siongui/frontend-programming-in-go/blob/master/wasm/005-xmlhttprequest-xhr/xhr.go#L10, this call is actually using the Fetch API under the covers, not XMLHTTPRequest (tested on modern Chromium, FireFox and Safari ... this may have changed since you published the example.)
In your WASM-XHR example at https://github.com/siongui/frontend-programming-in-go/blob/master/wasm/005-xmlhttprequest-xhr/xhr.go#L10, this call is actually using the
Fetch APIunder the covers, not XMLHTTPRequest (tested on modern Chromium, FireFox and Safari ... this may have changed since you published the example.)