From bf681695c79121586e42ae344b1a3498e3e815a0 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Sun, 13 May 2018 15:59:00 +0100 Subject: [PATCH] Remove bug folder --- bug/Makefile | 7 ------- bug/main.go | 20 -------------------- 2 files changed, 27 deletions(-) delete mode 100644 bug/Makefile delete mode 100644 bug/main.go diff --git a/bug/Makefile b/bug/Makefile deleted file mode 100644 index 57b6bfd..0000000 --- a/bug/Makefile +++ /dev/null @@ -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 diff --git a/bug/main.go b/bug/main.go deleted file mode 100644 index 3cbaf86..0000000 --- a/bug/main.go +++ /dev/null @@ -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 -}