hello i want to using “syscall/js”,but i get a error when i build
flb.go:5:2: build constraints exclude all Go files in C:\Go\src\syscall\js
My go version is “go1.13.5 windows/amd64”
my code as follow:
package main
import (
"fmt"
"syscall/js"
)
func main() {
var cb js.Func
cb = js.FuncOf(func(this js.Value, args []js.Value) interface{} {
fmt.Println("button clicked")
cb.Release() // release the function if the button will not be clicked again
return nil
})
js.Global().Get("document").Call("getElementById", "myButton").Call("addEventListener", "click", cb)
}
please help me fix it , and i’m really sorry for my poor English