reddit / emacs

How to correctly set eglot for wasm and go-lang?

gry3000 · 2022-12-09 08:24
My emacs setup on golang (eglot + gopls) works completely fine when I'm working on just go scripts. However, When I trying to learn wasm+go, eglot is output giving me following error: main.go 4 error compiler: error while importing syscall/js: build constraints exclude all Go files in /usr/lib/go/src/syscall/js it's probably because of not setting environmental variable, right?. The wasm code compiles with `$ GOOS=js GOARCH=wasm go build -o main.wasm`. And eglot doesn't know about `GOOS=js` and `GOARCH=wasm` yet.
shassard · 2022-12-09 21:49
This might help, though I admit I haven't tried this recently so YMMV: https://www.reddit.com/r/emacs/comments/dwbvwi/setenv\_goos\_for\_gomode/
gry3000 · 2022-12-10 03:25
This is the solution !!!. Thank you I haven't heard about `set-env` before. (this makes so much sense haha)