Preparation
This section guides you through the necessary steps to prepare your development environment for using the Mate SDK for Go, including system requirements and Go installation instructions for various operating systems.
System Requirements
To use the Mate SDK for Go, you need:
- Go Language: Version 1.18 or higher is recommended.
- Operating System: Windows, Linux, or macOS.
- Network Access: Ability to reach
https://api.mate.wyseos.com
(or your configured Mate API base URL) and WebSocket endpoints.
Go Installation
Before you can use the Mate SDK, you need to have Go installed on your system. Follow the instructions below based on your operating system.
Installation on Windows
-
Download the Installer: Visit the official Go website and download the MSI installer for Windows.
-
Run the Installer: Execute the downloaded MSI file and follow the prompts. The installer will typically install Go to
C:\Program Files\Go
and add thego\bin
directory to your system'sPATH
environment variable. -
Verify Installation: Open a new Command Prompt or PowerShell window and run:
go version
You should see the installed Go version.
Installation on Linux
There are several ways to install Go on Linux. Using your distribution's package manager is often the easiest.
Option 1: Using Package Manager (Recommended for most users)
-
Debian/Ubuntu:
sudo apt update sudo apt install golang-go
-
CentOS/Fedora:
sudo dnf install golang # For Fedora sudo yum install golang # For CentOS/RHEL 7 sudo dnf install golang # For CentOS/RHEL 8
Option 2: Installing from Tarball (For latest version or specific control)
-
Download the Tarball: Visit the official Go website and download the latest
go<version>.<os>-<arch>.tar.gz
file. -
Extract to
/usr/local
: Extract the archive to/usr/local
:sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf go<version>.<os>-<arch>.tar.gz
-
Set Environment Variables: Add Go to your
PATH
. Edit your shell's profile file (e.g.,~/.bashrc
,~/.profile
, or~/.zshrc
) and add the following line:export PATH=$PATH:/usr/local/go/bin
Then, apply the changes:
source ~/.bashrc # or ~/.profile, ~/.zshrc
-
Verify Installation: Open a new terminal and run:
go version
Installation on macOS
Option 1: Using Homebrew (Recommended)
If you have Homebrew installed, you can install Go with a single command:
brew install go
Option 2: Using the Official Installer
- Download the Installer: Visit the official Go website and download the package installer for macOS.
- Run the Installer: Double-click the downloaded
.pkg
file and follow the installation wizard. This will install Go to/usr/local/go
and set up thePATH
automatically.
Verify Installation (for both options)
Open a new terminal and run:
go version
Environment Variable Setup (General)
While the installers often set up the PATH
environment variable automatically, it's good to know how to verify or manually set it. Ensure that the go/bin
directory (e.g., /usr/local/go/bin
on Linux/macOS or C:\Program Files\Go\bin
on Windows) is included in your system's PATH
.
-
Linux/macOS: Check your
~/.bashrc
,~/.profile
, or~/.zshrc
file for anexport PATH
line. If not present, add:export PATH=$PATH:/usr/local/go/bin
Then
source
the file. -
Windows: You can manage environment variables through the System Properties. Search for "Environment Variables" in the Start menu.