Golang Setup In Windows
Quick Introduction About Golang
Golang or Go is a procedural programming language. It originally developed by Rob Pike, Robert Griesemer and Ken Thompson at Google however launched after two years as an open-source programming language. Programs are assembled by packages, for efficient management of dependencies. Golang also supports the environment adopting patterns alike to dynamic languages. For e.g., type inference (y := 0 could be a valid declaration of a variable y of type float).
Purpose of this article?
As we know Golang is one of the most popular languages nowadays. Today we will learn how to set up Golang in the windows operating system with VS Code and then also make a simple “hello world” program.
Let’s Begin
- In the first step, we download the Golang installable file for windows. Visit on https://golang.org/dl/ for download Golang exe file.
- Install downloaded Golang file by a double click as other Software.
- Now open a terminal and write command go version, you will get Golang version, if you get any error then add Golang path up to bin folder in an environment variable.
- Now Download Vs Code. Visit on https://code.visualstudio.com/download for download VS Code exe file.
- Install downloaded VS Code file by a double click as other Software.
- Open VS Code and go to Extensions and search Go then install it.
We have done all the setup that we will need. Now we’re creating a new file with “.go” extension and write code for print “Hello World” on a console. i.e. if you create a file by the name of first then your file should be first.go
package main import "fmt" func main() { fmt.Println("hello world") }
Run this code by using command go run first.go