could not import syscall/js (cannot find package "syscall/js" in GOROOT)
更新于
编写wasm时在vscode
中引入syscall/js
会报如下错误:
could not import syscall/js (cannot find package "syscall/js" in GOROOT)
在vscode
的settings中添加上如下配置即可:
{
"go.toolsEnvVars": {
"GOOS": "js",
"GOARCH": "wasm"
}
}