Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →The reliable way to install Go is to use the official installer for your operating system: the MSI package on Windows, the signed package on macOS, or the tar archive on Linux. After installation, open a new terminal and run go version. The command must be on your PATH; tools installed with go install normally live in a separate GOPATH bin directory that may also need to be added. Keep GOPATH (your workspace and cache) separate from GOROOT (the Go toolchain installation), and leave GOPATH at its default unless you have a specific reason to change it.
What you need before installing Go
Download the current stable Go release for your operating system and CPU architecture from the Go project’s official download page. Release numbers, archive names and package availability change, so select the version offered when you install rather than relying on an old filename in a tutorial.
As an Amazon Associate I earn from qualifying purchases.
- Windows: a user account allowed to install software and the official
.msiinstaller. - macOS: the official installer package and permission to install software under
/usr/local. - Linux: the official archive, a CPU-compatible build, and
sudoaccess if you will install under/usr/local. - A terminal: Command Prompt or PowerShell on Windows; Terminal with a shell such as zsh or bash on macOS; a shell such as bash on Linux.
The commands and module workflow are the same after installation. What differs is how the files are installed, where PATH is changed, how an existing installation is replaced, and how terminals pick up environment changes.
Installation methods at a glance
| Operating system | Official method | Toolchain location | Where PATH is changed | Refreshing terminals | Upgrade cleanup |
|---|---|---|---|---|---|
| Windows | MSI installer | Program Files or Program Files (x86) by default; you may choose another directory | The installer updates the Windows environment | Close and reopen Command Prompt or PowerShell windows | Usually handled by the installer; confirm the resulting version |
| macOS | Installer package | /usr/local/go |
The package adds /usr/local/go/bin through /etc/paths.d/go |
Start a new terminal; source your shell profile if you changed it manually | Run the package installer; remove obsolete manual PATH entries if you created any |
| Linux | Compressed archive | /usr/local/go |
Your shell profile, commonly ~/.profile or /etc/profile |
Open a new shell or source the profile | Remove the old /usr/local/go tree before extracting the replacement |
Install Go on Windows
1. Run the MSI installer
- Download the Windows MSI that matches your system architecture.
- Open the downloaded
.msifile. - Follow the installation prompts and accept the license terms.
- Keep the default destination unless your organization requires another location. The default is under
Program FilesorProgram Files (x86); the wizard lets you change it. - Finish the installation, then close every existing Command Prompt and PowerShell window.
Closing old terminals matters because each process inherits its environment when it starts. A prompt that was open before the MSI changed PATH may continue reporting that go is not recognized even though the installation is correct.
#1 Best Overall
- Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
2. Verify from Command Prompt or PowerShell
Open a fresh Command Prompt or PowerShell window and run:
go version
The output should identify the installed Go release and your platform. If Windows says that go is not recognized, inspect the PATH entries in System Properties > Advanced > Environment Variables. The Go installation’s bin directory must be present in either the user or system Path variable. After correcting it, open another new terminal and run go version again.
3. Add the directory for installed Go commands
The Go compiler is normally available after the MSI updates PATH, but executables installed with go install are placed in the bin directory under GOPATH unless you deliberately configure GOBIN. With the default GOPATH, add this directory to your user Path:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitches%USERPROFILE%gobin
Use System Properties > Advanced > Environment Variables, select the user-level Path, choose Edit, select New, enter the directory, and confirm all dialogs. Open a new PowerShell or Command Prompt window before testing an installed command by name.
Install Go on macOS
1. Open the package
- Download the macOS package for the architecture of your Mac.
- Open the downloaded installer package and follow the prompts.
- Allow the installer to place Go under
/usr/local/go.
The package also adds /usr/local/go/bin to the system path mechanism through /etc/paths.d/go. That makes the go command available to newly started shells without requiring you to edit a profile just for the toolchain.
2. Start a new shell and verify
Quit and reopen Terminal, then run:
go version
If the command is missing, check that /usr/local/go/bin is reachable:
echo "$PATH"
ls /usr/local/go/bin/go
If the file exists but the command is still unavailable, start another terminal window. A profile or shell started before the package installation will not automatically receive the updated path.
Rank #2
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
3. Put installed Go tools on PATH
Commands installed with go install are normally written to $(go env GOPATH)/bin. On current macOS installations, zsh is the usual shell. Add the directory to your zsh profile:
echo 'export PATH="$PATH:$(go env GOPATH)/bin"' >> ~/.zshrc
source ~/.zshrc
If you use bash instead, put the same export line in ~/.bash_profile (or the profile your terminal loads) and source that file, or simply open a new terminal. The command substitution uses Go’s configured GOPATH, so it continues to work if you later choose a different workspace.
Install Go on Linux
1. Remove an older toolchain tree
For an installation under /usr/local/go, remove the previous tree before extracting the new archive:
sudo rm -rf /usr/local/go
The Go project specifically warns: “Do not untar the archive into an existing /usr/local/go tree. This is known to produce broken Go installations.” Leaving files from two releases mixed together can produce mismatched standard-library files and confusing version results.
Free tools Windows power users keep installed
One-click scans. No signup required.
2. Extract the downloaded archive
Change to the directory containing the single downloaded Linux archive, then extract it into /usr/local. The wildcard below should match only the archive you intend to install:
cd ~/Downloads
sudo tar -C /usr/local -xzf go*.linux-*.tar.gz
The archive creates /usr/local/go. If the wildcard matches more than one file, specify the intended archive explicitly instead of extracting all of them.
3. Add the toolchain to PATH
Add the following line to ~/.profile for your user account:
Rank #3
- Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
- 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
- ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
- ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
- ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
export PATH="$PATH:/usr/local/go/bin"
Apply it to the current shell with:
source ~/.profile
On a machine where every user should receive the setting, an administrator can place the export in /etc/profile. A new login shell is required after changing that file.
4. Add the GOPATH bin directory when needed
To run executables installed by go install by name, add the GOPATH bin directory as well. With the default Unix GOPATH, this is $HOME/go/bin:
export PATH="$PATH:$HOME/go/bin"
If you have customized GOPATH, use the value reported by go env GOPATH and append /bin to it. Put the resulting export in the same profile, source the file, and then open a fresh terminal to confirm that the change survives new sessions.
PATH, GOROOT, GOPATH, and GOBIN explained
GOROOT: the Go installation
GOROOT identifies the directory containing the Go distribution and standard library. For the package and archive procedures above, it is normally /usr/local/go on Unix-like systems and the directory selected by the Windows installer. You generally should not set GOROOT manually; the go command can determine it from its own installation.
GOPATH: your workspace and cache
GOPATH is separate from the toolchain. It is used for downloaded module data and, by default, the bin directory where go install puts command-line tools. The official defaults are:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Platform | Default GOPATH | Tool bin directory |
|---|---|---|
| Linux and macOS | $HOME/go |
$HOME/go/bin |
| Windows | %USERPROFILE%go |
%USERPROFILE%gobin |
Most developers do not need to set GOPATH. Go modules let each project declare its dependencies in a go.mod file, so projects do not have to live inside GOPATH. Do not make GOPATH the same directory as the Go installation; a GOPATH/GOROOT conflict can break the installation and cause misleading errors.
Changing GOPATH deliberately
Choose a custom workspace only when you have a clear reason, such as a managed workstation, a separate disk, or an existing development layout. Use go env -w so Go stores the setting:
Rank #4
- Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
- Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
- Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
- EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
- Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
go env -w GOPATH=$HOME/go-work
On Windows PowerShell, a Windows path can be configured as:
go env -w GOPATH=c:go-work
Use a directory that is not the Go installation. Check the result with:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →go env GOPATH
go env GOROOT
If you change GOPATH, update PATH to point to its bin subdirectory. A profile edit does not affect terminals that are already running, so source the profile or open a new shell.
GOBIN: an optional destination for installed commands
GOBIN overrides the default GOPATH bin location. It is useful when you want tools in a dedicated directory, but it creates another PATH requirement. If you configure it, ensure that the directory reported by go env GOBIN is on PATH. Otherwise, leave GOBIN unset and use the standard GOPATH bin directory.
Verify the installation completely
Check the executable and environment
Run these commands in a new terminal:
go version
go env GOROOT
go env GOPATH
go env GOBIN
go version proves that the command is found and can start. The environment queries show where Go considers the toolchain, workspace and optional binary directory to be. On Windows, run them in either PowerShell or Command Prompt; on macOS and Linux, run them in your shell.
Create and run a first module
A small module is a better smoke test than checking the version alone because it exercises the compiler, standard library and module tooling:
- Create a directory and enter it:
mkdir hello
cd hello
- Initialize a module:
go mod init example/hello
This creates go.mod with the module path example/hello. The path is an identifier for this demonstration; it does not require a published repository.
Best Value
- Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
- Create a file named
hello.gocontaining:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
- Run the module:
go run .
The expected output is Hello, World!. The dot tells Go to run the main package in the current module.
When dependencies are added
After you import an external module, run:
go mod tidy
go mod tidy records the requirements needed by the packages in your module and updates the checksums used to verify downloaded modules. Commit the resulting go.mod and go.sum files when they are part of your project’s normal source-control workflow.
Common failures and precise fixes
“go” is not recognized or “command not found”
- Run
go versionin a newly opened terminal; old processes retain the old PATH. - Confirm that the toolchain directory is on PATH: the Windows installation directory’s
bin,/usr/local/go/binon macOS, or/usr/local/go/binon Linux. - On macOS or Linux, inspect the profile you actually use. zsh commonly reads
~/.zshrc, while login shells may read~/.profileor~/.bash_profile. - On Linux, run
source ~/.profileafter editing it, or log out and back in. - If the executable is present but another installation appears first, inspect PATH order and remove stale entries.
GOPATH and GOROOT point to the same directory
Run go env GOPATH and go env GOROOT. If they return the same path, set GOPATH to another directory, for example:
Recommended Free Tools
go env -w GOPATH=$HOME/go-work
On Windows, use a separate path such as c:go-work. Recheck both values and ensure the new GOPATH bin directory is on PATH.
An installed command cannot be run by name
Find the destination first:
go env GOBIN
go env GOPATH
If GOBIN is empty, the executable is normally under the bin directory of GOPATH. Add that directory to PATH, open a new terminal, and try the command again. If GOBIN contains a value, add that exact directory instead or unset GOBIN if you do not need a custom destination.
Linux reports a broken or inconsistent installation after an upgrade
Do not extract a new archive over the old /usr/local/go tree. Remove the tree, extract the new archive into /usr/local, reload PATH, and run go version. This avoids retaining files from the previous release.
The version is not the one you expected
More than one installation may be present. On Unix-like systems, use which go; on Windows, use where go. The first path listed is the executable your shell runs. Remove obsolete PATH entries or reorder them so the intended installation comes first, then open a fresh terminal.
Editors and the next learning step
The official Go tutorial identifies VS Code, GoLand and Vim as editors with Go support. An editor is optional: the compiler, formatter and module commands work from a terminal. Choose an editor that can display diagnostics, run tests and format Go source, then install any Go-language extension or plugin it recommends.
For a structured follow-on reference, The Go Programming Language by Alan A. A. Donovan and Brian W. Kernighan (Addison-Wesley Professional, published October 26, 2015; ISBN-13 978-0-13-419044-0) starts with a tutorial and progresses through practical examples, concurrency and testing. Edition, price and regional availability vary, so verify those details with the seller before purchasing.
Windows, macOS, or Linux: what actually changes?
Choose the operating system you already use unless a project or deployment target dictates otherwise. Windows minimizes manual setup because the MSI updates the environment, macOS uses the package and /etc/paths.d/go, and Linux gives you the most control through an archive and shell profiles. Once go version succeeds and both the toolchain and any required bin directory are on PATH, module commands such as go mod init, go run . and go mod tidy behave the same way on all three systems.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

