Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imports syscall/js: build constraints exclude all Go files in D:\Go\src\syscall\js #43865

Closed
capyun opened this issue Jan 23, 2021 · 1 comment

Comments

@capyun
Copy link

capyun commented Jan 23, 2021

What version of Go are you using (go version)?

$ go version
go 1.15.6

Does this issue reproduce with the latest release?

i don't know

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=wasm
set GOBIN=
set GOCACHE=C:\Users\Sxy\AppData\Local\go-build
set GOENV=C:\Users\Sxy\AppData\Roaming\go\env
set GOEXE=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\Study\ProgramData\GoPath\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=js
set GOPATH=D:\Study\ProgramData\GoPath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set GOWASM=
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-fPIC -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Sxy\AppData\Local\Temp\go-build345168030=/tmp/go-build -gno-record-gcc-swi
tches

What did you do?

run a program in goland:
package main

import "syscall/js"

func main() {
alert := js.Global().Get("alert")
alert.Invoke("Hello World!")
}

What did you expect to see?

no errors

What did you see instead?

Run 'go build main.go'
package command-line-arguments
imports syscall/js: build constraints exclude all Go files in D:\Go\src\syscall\js
Compilation finished with exit code 1

or

go run main.go
exec: "C:\Users\Sxy\AppData\Local\Temp\go-build246431802\b001\exe\main": file does not exist

@seankhliao
Copy link
Member

syscall/js is only valid for the js and wasm platforms
For questions please refer to https://github.com/golang/go/wiki/Questions

@golang golang locked and limited conversation to collaborators Jan 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants