Welcome to the new Golem Cloud Docs! 👋
Go Language Guide
Setup

Setup Go

Creating Golem components in Go requires using the latest version of the TinyGo compiler (opens in a new tab) and installing some common WebAssembly tooling.

Installing TinyGo

Use the official guide (opens in a new tab) to install the latest stable version of the TinyGo compiler.

Note that TinyGo also requires Go to be installed too. Follow the recommended steps here (opens in a new tab) to download and install the latest recommended version.

For MacOS TinyGo can be installed using brew:

brew tap tinygo-org/tools
brew install tinygo
⚠️

The minimum versions assumed by the documentation and templates are the following:

  • TinyGo: 0.37.0
  • Go: 1.24.0

Install WebAssembly tooling

First of all, to install wasm-tools via cargo, you need to install the latest stable version of Rust. The recommended way to do so is using https://rustup.rs (opens in a new tab):

Install Rust

Install rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install the latest stable version of Rust

rustup install stable && rustup default stable

Add the WASI target

rustup target add wasm32-wasip1

Install wasm-tools

cargo install --force --locked  wasm-tools@1.227.1

Confirm the installation:

wasm-tools --version
wasm-tools 1.227.1