sycall/js : does it require build tags? if so whihc ones?

264 views
Skip to first unread message

atd...@gmail.com

unread,
Jan 23, 2021, 6:57:32 PM1/23/21
to golang-nuts
Hello,

I'm using atom and am trying to import the syscall/js package.

My issue is that I do not know which build constraints I should specify for the static analysers to process the code.
I'm getting a message as such:
js.go:7:3: build constraints exclude all Go files in /usr/local/go/src/syscall/js

I am using atom with go-plus.

Any suggestions?

Jan Mercl

unread,
Jan 23, 2021, 7:24:09 PM1/23/21
to atd...@gmail.com, golang-nuts
On Sun, Jan 24, 2021 at 12:57 AM atd...@gmail.com <atd...@gmail.com> wrote:

> My issue is that I do not know which build constraints I should specify for the static analysers to process the code.

Seems like js _and_ wasm: https://golang.org/src/syscall/js/js.go#L5

at diar

unread,
Jan 31, 2021, 9:21:31 PM1/31/21
to Jan Mercl, golang-nuts
Thanks. I think I figured it out. Apart from the build tags that you have mentioned, depending on the code editor, the build tool need to be specified GOOS and GOARCH too.

And some of the old code completion tools do not support the new syscall/js package. 

In my case, using atom.io, I had to launch it using $ GOOS=js GOARCH=wasm atom

And I have just uninstalled go-plus. Now using gopls based code tips and completion etc. 
Reply all
Reply to author
Forward
0 new messages