1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00

Remove bug folder

This commit is contained in:
Johan Brandhorst 2018-05-13 15:59:00 +01:00
parent f6afc46304
commit bf681695c7
No known key found for this signature in database
GPG Key ID: 266C7D9B44EAA057
2 changed files with 0 additions and 27 deletions

View File

@ -1,7 +0,0 @@
build: clean compile
clean:
rm -f ../html/test.wasm
compile:
GOOS=js GOARCH=wasm GOROOT=$(GOPATH)/src/github.com/neelance/go/ $(GOPATH)/src/github.com/neelance/go/bin/go build -o ../html/test.wasm main.go

View File

@ -1,20 +0,0 @@
// +build js,wasm
package main
import (
"syscall/js"
"syscall/js/callback"
)
func main() {
wait := make(chan struct{})
promise := js.Global.Call("fetch", "https://api.github.com")
promise.Call("then", callback.New(func(args []js.Value) {
response := args[0]
r := response.Get("body").Call("getReader")
r.Call("read")
close(wait)
}).Value)
<-wait
}