Sample Video Frame
01: Gearing Up
WARNING This exercise is in DRAFT status, so there may be errors. If you find any, please email me at help@learncodethehardway.com so I can fix them.
One major motivation to using Go is its install story. You install Go by extracting a pre-built binary and you're done. Most Go software is also installed this way, and deploying Go software is mostly as simple as copying a single binary to a server or client. It may seem like a minor thing but compared to languages like C++, C, Python, Ruby, and JavaScript, it's a dream. In this exercise you'll experience this for yourself, and learn how to get Go running on your computer of choice.
Windows
Windows is the most difficult to install, but that's mostly because of Windows and not really a Go problem. I primarily develop my Go projects on Windows, so I know it works well there. To get Go installed do this:
- Go to the Go Download Page and select the Microsoft Windows installer, usually named
goVERSION.windows-amd64.msi. TheVERSIONpart will be something like 1.25.5, and only needs to be 1.25 or greater. - Open your
Downloadsdirectory and find this file. Double Click It. - Click
Nextto accept the defaults until you are either asked for your login/password, or the install starts. When it's done clickFinish. - Once that's done you can close all open Terminals and start a new one. To start a new terminal hit your
Winkey (Start Meny) and search for "PowerShell". - Finally, type
go versionand it should print out a version number that matches theVERSIONin your download from step 1.
Additionally, you should run these two commands from your PowerShell:
winget install Geany.Geany
winget install Microsoft.WindowsTerminal
That will install a basic text editor and a better Terminal than PowerShell. To run the new Terminal just search for "Terminal" in the Start Menu like before.
Ubuntu Linux
I'm going to show you how to install on Ubuntu Linux because it has an outdated version of Go as the default. This means you need to install an official version from Go's website.
- First check if you have Go already by typing
go version. If you do and it's version 1.25 or greater then you are done. If not then you'll need to remove this first usingapt remove golang. - Go directly to the actual Go download page and select the Linux build for your system. For me it is (was) labeled
go1.25.5.linux-amd64.tar.gzbut the version might be different. - Now go to the Go download page and select the Linux tab if it's not already selected. In there are instructions for installing Go.
- First you install Go with
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.25.5.linux-amd64.tar.gz - Next you need to add the
/usr/local/go/binto yourPATHwithexport PATH=$PATH:/usr/local/go/bin. This probably needs to go in your.bashrcor.bash_profileor where you usually maintain yourPATH. - After that restart you terminal and you can type
go versionto confirm you have1.25or later.
OSX aka macOS
Installing on macOS is so easy I didn't even bother to make a video:
- Check if you already have Go installed by typing
go versionin Terminal. If you do and it's 1.25 or greater than you're done. If not then you have to remove it to get the new one. - Go to the official download page.
- Download the installer package.
- Run it.
- After it installs open a new Terminal and type:
go versionto see that you have a version after 1.25.
That's it. Like I said, very easy to get Go on most any computer.
Additional Tools
This course is primarily aimed at programmers who know at least one language, but I think an ambitious total beginner could complete it with extra effort. If you're highly motivated and know nothing, then you'll need two other things:
- A Terminal. Most operating systems have this already, but Windows is a little weird which is why I included instructions for install Windows Terminal. If you're using another OS then find your Terminal and make sure you can run it easily.
- A Text Editor. Just about any text editor will work, but try out Geany if you want something simple that can run on low power computers. You can use VSCode but it's mostly "too much" editor for the things you'd learn.
If you're a professional or already know a language then I leave you to your own tools. One recommendation I'll give you is turn off all your help. Disable your LSP, autocomplete, and AI tools while you're learning. These tools tend to keep you from really learning the material by doing too much for you, and if you disable them you'll learn better and retain more.
Register for Learn Go the Hard Way
Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.