Go lang installation guide on windows
Go turns 10

What is Golang? And how to install it.

Ritik Sinha
6 min readNov 13, 2019

--

Google’s Go Programming Language (Golang) turns 10 last weekend. We celebrated the 10th anniversary of Go as an open-source programming language and ecosystem for building modern networked software.

Happy birthday, Go!

What is Golang?

Go is a lightweight, open-source programming language suited for microservices architectures. It is somewhat like C programming Language. What Makes Go As Static Language. It provides many modern features that make it very powerful. Features like methods, operators, overloading, pointers, arithmetic type inheritance and many more. Container darling Docker and Google’s container orchestration product Kubernetes are built using Go. It is also gaining ground in data science. Today it is used by millions of developers.

It is an engineered language (rather than something that evolved over time), it benefits developers in multiple ways, including garbage collection, native concurrency, and many other native capabilities that reduce the need for developers to write code to handle memory leaks or networked apps. it also provides many other features that fit well with microservices architectures and data science.

Its development began in 2007 at Google. Robert Griesemer, Rob Pike and Ken Thompson are the guys behind the development of Go. Google made it public back in 2009. And it has gained lots of attention from 2017.

So should you learn it in 2019 or 2020?

Today we have lots of programming languages like celebrity Python, the undisputed king of the web JavaScript, evergreen C/C++ and rock-solid Java. But the fact is that even if we have dozens of choice but we cannot ignore languages like Go and Rust (I will talk it about in some another blog).

So I decided to give it a try. I installed it on my machine and build some of the classic programs. Believe me, it was fun. It is always fun to learn something new.

So let’s get started. In this article, I will guide you on how to install Go’s compiler on windows(basically it is the same for all os )and will write a classic hello world program.

To write go programs we need two things:

1. Go Compiler

We will download it from its official website. Visit golang.org

2. IDE (Integrated Development Environment)

In the official docs, it is recommended to use these IDEs

1. VS code

2. Atom

3. GoLand

4. Vim

In this article, we will go with the VS code (my all-time favorite).

So let’s download the VS code and Go compiler.

Step 1

Download Golang compiler from the official website.

We will download it for windows 64 bit or 32 bit depending upon your machine. After downloading it, we will double click to install it.

Click on the Run button.

Click on Next Button

Agree on the terms in the License Agreement. (we have no choice.)

It is showing the path directory of the installation, yes we can change it, but we will leave it as default.

Now click on install and wait for the installation. It will take a few seconds depending upon your machine.

After the installation click on the finish button and let’s move to the next part.

You have just installed it. Let’s check it if it is correctly installed or not

go to the path directory. If you have followed along then you can visit this directory

Notice the go application and gofmt( Gofmt formats Go programs.). Now let’s verify it from the terminal.

open power shell or cmd and type go and press enter.

If you're seeing this then you are fine. That means you have successfully installed go runtime to build and execute the program.

Step 2

I assume that you have downloaded the vs code(as it is pretty simple to do)

Note:- Vs code is the optional part you can use any IDEs or editors (sublime, atom, etc.). You don’t have to use vs code but I will highly recommend using it.

open your vs code now it’s time to configure it to run Go programs.

Step 3

Open the vs code and install Go extension

This extension is just really a bonding layer between our code editor and a set of underlying command-line tools that are actually responsible for doing some code quality check of any open file.

the extension adds support to the language or our editor for us. We only have to make sure that it has the ability to install extra tools so that it can function properly.

Just make a file with any name but with .go extension That will trigger the Go extension (that we have installed in vs code). it will show us little warning that it needs extra tools to function properly. just click on install and wait for the installation.

You will see SUCCEEDED in your terminal. That’s it. You have configured vs code for Go programming.

Now it’s a fun part let’s write and run our program.

package main

import “fmt”

func main() {

fmt.Println(“Hello world!”)

}

now save it with .go extension. I will explain this program in the next blog post.

now let’s run it in the terminal. There is an integrated terminal in vs code.

open it using(ctrl +`)

and type go run hello.go

you will see the magic.

Yes, you have written your first program in GO. I know it just printed hello world but believe me it’s a great start.

for a side note if you just want to see and experience the syntax you can visit GoLang Playground

If you have got any problem or any suggestion you check me out on Instagram my user handle is (ritik.js). and ritikSinha on Github.

Wrapping It Up

If you’re coming from a JS/Node or Python background, you need to learn some new programming concepts such as coroutines, channels, strict typing with structs, pointers, interfaces, compilation, and some other differences. But, once you get through it, you’ll find Golang easier and faster to use.

Happy Coding!

--

--

Ritik Sinha

Hello World ! it’s Ritik. I’m self-taught programmer. I work as a freelancer. And I love to learn and explore in the world of technology. www.ritiksinha.in