From the course: Learning Go

Install Go on macOS - Go Tutorial

From the course: Learning Go

Install Go on macOS

- [Instructor] In order to install Go on MacOS, visit this webpage at golang.org/dl for download. You'll find links for all the supported operating systems. Click the link to download the PKG file for MacOS. When you click this link, you'll come to this page that has some instructions, but there really isn't much there because the installation is so simple. So I'm going to close my browser and show that I've already downloaded the installer to my desktop. I'll double click to start up the application. Now I already have Go installed on my computer, so I see this message saying that there's a previous installation detected. I can continue onward and if there's an older version of Go, it'll be uninstalled before the new one is installed. I'll continue onward, and then if I were to click the Install button, the installation would progress. There aren't any other options available. On MacOS the Go tools are always installed in the same place. To find that directory go to a terminal window and type export $PATH, and you should see a listing of the directory usr/local/go/bin. In addition, there's also a Go command that's added to a director, rephrase-- There's also a file that's added to a directory called etc/paths.d. It's under the root and you'll see that there's a Go file there. And I'm going to open it up with the Nano editor, typing nano go, and that is now pointing to that other directory. To test and make sure that you can get to the Go command from anywhere, go to your home directory and type go space version. And if everything's working correctly, you should see this output indicating the version of Go that you're using. I'm using version 1.15 of Go on MacOS, but if you're watching this course at a later time you might have access to a later version of the Go development tools, and that should be fine. As Go has continued to evolve, it's continued to remain backward compatible with older versions. If you're able to see the version, you're ready to start programming with Go on MacOS.

Contents