Showing posts with label Setup. Show all posts
Showing posts with label Setup. Show all posts

Wednesday, October 28, 2020

How to Install Go on MacOS

Installing Go in MacOS is very simple! Learn how in this tutorial

So you're ready to learn Go and need some help installing it on Windows? Sure, let's get started! On this tutorial let's learn how to install it on Windows.

Downloading Go for MacOS

Installing Go on Windows is actually very simple. Open Go's download page and download the MacOS installer. Since Go's follows a frequent release schedule, it may be more up to date than this. Click on the installer to download it (in our example, go1.15.3.windows-amd64.msi):

The Go installer for MacOS

Open the package file you downloaded and follow the prompts to install Go. Accept the license agreement, click Next and proceed with the installation.

The package installs the Go distribution to /usr/local/go. The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.

After it has completed installing, let's test your setup next.

Testing the Installation

Once the installation finishes, it's time to check if Go was correctly installed in your system. To verify that you've installed Go by opening a command prompt and typing the following command:

go version

If you see a message like the below, it's because Go was installed successfully.

go version go1.15.3 darwin/amd64

Testing GOPATH

Let's now test if the GOPATH environment variable was correctly set (it should) with:

echo $GOPATH

You should see something like:

/Users/<your-user>/go

Congratulations! You have go installed in your system!

Conclusion

On this quick tutorial we learned how simple it is to install Go on MacOS. Not sure why you should learn Go? Check our main reasons to learn Go.

References

See Also

Monday, October 26, 2020

How to install Go on Windows

Installing Go in Windows is very simple! Learn how in this tutorial

So you're ready to learn Go and need some help installing it on Windows? Sure, let's get started! On this tutorial let's learn how to install it on Windows.

Downloading Go for Windows

Installing Go on Windows is actually very simple. Open Go's download page and download the Windows installer. Since Go's follows a frequent release schedule, it may be more up to date than this. Click on the installer to download it (in our example, go1.15.3.windows-amd64.msi):

The Go installer for MacOS

Now run the installer. Accept the license agreement, click Next and proceed with the installation.

By default the installer installs Go in C:\Go. You can change the location as needed but since that's a pretty standard setup, we recommend leaving it there. After installing, you will need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt.

After it has completed installing, click Finish to complete the setup. We'll test your setup next.

Testing the Installation

Once the installation finishes, it's time to check if Go was correctly installed in your system. Open a command prompt (Start -> Command Prompt) and type:

go version

If you see a message like the below, it's because Go was installed successfully.

go version go1.12.7 windows/amd64

Testing GOPATH

Let's now test if the GOPATH environment variable was correctly set (it should) with:

echo %GOPATH%

You should see something like:

C:\Users\<your-user>\go

Congratulations! You have go installed in your system!

Conclusion

On this quick tutorial we learned how simple it is to install Go on Windows. Not sure why you should learn Go? Check our main reasons to learn Go.

References

See Also

Any comment about this page? Please contact us on Twitter

Featured Article

Pointers in Go

Understand all about declaring and using pointers in Go If you're coming from Python, Java, JavaScript, C# and others, tal...

Popular Posts