Back to Concepts Roadmap
🟢 Level 0 — Absolute Basics
Foundation

Installation & Setup

Step-by-step guide to installing the official Go compiler, configuring environment paths, and setting up VS Code or GoLand.

Real-World Analogy (Mental Model)

Installing Go is like setting up a carpenter workshop: GOROOT is the storage shed where the factory tools live, and GOPATH/workspace is your personal workbench.

Architecture & Memory MapVisual Model
[Terminal] ──> go version ──> go1.24+ Installed!
     │
     ├── GOROOT: Location of standard library & compiler
     └── GOPATH: Downloaded third-party modules cache

Key Concepts & Rules To Remember

  • Download and install from the official site (go.dev).
  • Verify installation with `go version` in your terminal.
  • Install the official Go extension in VS Code for instant autocompletion and error detection powered by `gopls`.
  • Initialize any new project anywhere with `go mod init <name>`.
Step-by-Step Code

1. Verifying Your Installation

Once installed, open any terminal or command prompt and run `go version`. You should see the active Go version and CPU architecture.

example.goGo 1.24+
$ go version
go version go1.24.0 linux/amd64

# Check active environment settings
$ go env GOPATH GOROOT
Step-by-Step Code

2. Setting Up Your Editor

Install Visual Studio Code and install the official "Go" extension by Google. This automatically installs `gopls` (the official Go language server), giving you syntax highlighting, auto-imports on save, and type hints.

example.goGo 1.24+
// .vscode/settings.json (Recommended Beginner Settings)
{
  "editor.formatOnSave": true,
  "go.useLanguageServer": true
}

Common Beginner Pitfalls & Mistakes

Mistake: Thinking you must put all projects inside `~/go/src` (the old GOPATH way).
✅ Correct Way: Modern Go uses Go Modules! You can create your projects in ANY folder on your computer by running `go mod init myproject`.
Self Assessment

Knowledge Check

Verify your understanding with these interactive practice questions.

Quizzes

Quick checks for understanding

Multiple-choice with inline explanations—expand to see why.

Which tool provides intelligent autocomplete, error squiggles, and refactoring in your code editor?

Finished this lesson?

Mark it as complete to track your overall Go mastery.