There are so many programming languages that exist in the world of technology. Go is one of them; which in full means Golang. Go programming language is well known by the developer community due to the benefits it portrays. It was developed in 2009 by a team at Google and other contributors. Golang aims to simplify software development, especially for complex architecture. In other words, Golang is easy to learn and straightforward when you are working with it. Due to its performance and high compilation speed, Go can solve a lot of critical problems. In this guide, I will take through the introduction, features, installation, and usage of Golang 1.17 on Windows 10/11.

Use cases of Go

  • Enables building of cloud-native applications: Golang allows you to build scalable and reliable applications that meet modern requirements.
  • Perfect for Blockchain technology
  • Used in database implementation
  • Golang has drivers that enable you to work with database packages.
  • Machine Learning: Gives developers a platform to build machine learning solutions using Go.
  • Developing Web applications: Suitable for current Web Development with outstanding security and Go frameworks such as Go craft and Mango.
  • Supports DevOps(Development Operations) and SRE(Site Reliability Engineering)
  • Golang provides a user-friendly platform to streamline DevOps operations.

 New features  in Go 1.17

Go 1.17 was released on  16 August 2021. Here are the new features of Go 1.17:

  • An added feature to the compiler. There is an advanced way of passing function arguments and results.
  • Supports 64-bit ARM architecture on Windows
  • Pruned module graphs.These are graphs that only have immediate dependences saving time on development process.
  • Changes on Go 1.17 language. There are three things that have changed which include safer pointer arithmetic, safer conversations of pointers to slices and slices to array pointers functions.

Install Go(Golang) 1.17 on Windows 10 / Windows 11

For you to use Golang on Windows 10/11, download it from Go official website.

Go ahead and click on Go 1.17 file for it to download.

After the set-up has completed downloading, find it on your computer’s downloads.

Right-click on the file and hit on install.

From the small window that will appear, click on next to continue with the installation of Golang 1.17.

Accept the license agreement for Golang 1.17 and hit on Next.

Select the destination for your Go file.

Continue by pressing the install button to get Golang 1.17 running on your Windows 10/11.

Wait for some time as the installation for Go 1.17 takes place.

Click on Finish to start using Golang on Windows 10/11.

Setting Environment Variable for Golang on windows 10/11

From your computer search bar, type the word env. Then click on open to edit environment variables.

A small window will open as illustrated below and click on environment variables.

When you click on the environment variables, a window will appear with a couple of options including adding new or editing existing variables. In our case, let’s click on Edit from the user variables.

An easy way to edit user variables is by copying the path for a Go. Without closing the environment variable window, access the destination folder for Go 1.17.

Right-click and copy the address that denotes the Golang path.

Go back to the editing user variable window and paste the path on the small screen that had already popped.

To save the changes, click on OK on the small screens.

Test whether Golang has Installed

Search for command prompt on your computer then run CMD as an administrator.

When the command prompt opens, type the word go and hit the ENTER button. It should display lines of codes as an indication that Golang 1.17 was successfully installed on Windows 10/11.

Usage Example of Go(Golang) 1.17 on Windows

To start writing codes using the Go programming language, you need a text editor. In my example, I will use Visual Studio Code to write a small program.

In your computer, find the destination folder for Go and create a new Hello directory on the src folder as illustrated below.

We will use the Hello folder to store the files or Go programs that we will create. Let’s continue by opening our text editor. From your code editor, create a new file.

Save the file on the Hello folder that we created. Name the file as HelloWorld.go

Inside the new file, copy-paste this code:

package main

import “fmt”

func main() {
fmt.Println(“hello world”)
}

See screenshot below:

To get the output of our hello world example, you can use two ways.

Run from the Code Editor

Click the run button from your Code Editor. The output which is Hello World will be displayed.

Run from Command Prompt

Golang allows you to run files on command line interfaces by typing simple commands.

In your command prompt type go run “c:\Program Files\Go\src\Hello\helloworld.go” and hit the ENTER button.

Hello World will be displayed as the output. You can create simple or complex programs following the same steps.

Conclusion

Golang is an exciting language that has a great impact on the world of programming. This article has covered most of the things you need to know about the Go programming language. We have seen that with Go 1.17 installed on Windows 10/11, it is possible to create and run codes on your computer. Go ahead and use this amazing tool. If you run into any errors, you can always leave a comment.

Other Guides:

LEAVE A REPLY

Please enter your comment!
Please enter your name here