This is an example of setting up TinyGo via VSCode's devcontainer.
First docker pull tinygo/tinygo-dev as it is used internally.
$ docker pull tinygo/tinygo-dev
Install Visual Studio Code Remote - Containers.
Enable remote container with Remote-Containers: Reopen in Container
The examples in examples/wasm are very easy to execute.
$ cd ./examples/wasm/
$ make slices
$ go run ./server.go
TinyGo target
and selectwasm
- Add GOOS/GOARCH to
./.vscode/settings.json
- Reload window (
>Developer: Reload Window
)
{
"go.toolsEnvVars": {
"GOOS": "js",
"GOARCH": "wasm",
"GOROOT": "...",
"GOFLAGS": "...",
}
}
The following PRs attempt to improve the situation.
The following are used internally
- https://golang.org/x/tools/gopls
- https://golang.org/x/tools/cmd/goimports
- https://marketplace.visualstudio.com/items?itemName=tinygo.vscode-tinygo
- https://github.com/sago35/tinygo-autocmpl
The configuration file can be found at
MIT
sago35 - sago35@gmail.com