-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux Go Language Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to Go programming language on Linux, covering Arch Linux, CachyOS, and other distributions including installation, workspace setup, and development.
Arch/CachyOS:
# Install Go
sudo pacman -S go
# Or latest from golang.orgDebian/Ubuntu:
sudo apt install golang-goFedora:
sudo dnf install golangCheck Go:
# Check version
go version
# Check environment
go envCreate workspace:
# Create workspace
mkdir -p ~/go/{bin,pkg,src}
# Set GOPATH
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/binModern Go (modules):
# Initialize module
go mod init example.com/project
# Build
go build
# Run
go run main.goCreate program:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}Compile:
# Build
go build main.go
# Run
./main
# Or run directly
go run main.goCheck installation:
# Check Go
which go
# Install if missing
sudo pacman -S goFix modules:
# Download dependencies
go mod download
# Tidy modules
go mod tidyThis guide covered Go installation, workspace setup, and development for Arch Linux, CachyOS, and other distributions.
- Development Environment - Development setup
- VS Code Guide - VS Code setup
- Go: https://go.dev/
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.