What is Golang and how to install it
What is Golang:
- Go is an open-source programming language that makes it easy to build simple, reliable, and efficient software.
- it is a procedural and statically typed programming language having the syntax similar to C programming language. Sometimes it is termed as Go Programming Language.
- It provides a rich standard library, garbage collection, and dynamic-typing capability.
- It was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launched in 2009 as an open-source programming language and mainly used in Google’s production systems.
- Golang is one of the most trending programming languages among developers.
Installing golang in your pc
You need to visit this link to download go click here.
You will see this page and from here you can download whichever versions you need.
Right-click on the installer and click on install.
After this, the go will be successfully installed on your computer.
You also need a text editor to write and execute go programs
Text Editor: Text editor gives you a platform where you write your source code. Following are the list of text editors:
- Vs code
- OS Edit command
- Windows notepad
- Epsilon
I prefer vs code for programming and for same I will show you how to run your first program in it.
You can download vs code by clicking here
Writing the first program in Go:
package main
import “fmt”
func main() {
// prints geeksforgeeks
fmt.Println(“Hello, geeksforgeeks”)
}
Just type above program in a new file in your text editor and save with extension (.go).
The output should be:
Hello, geeksforgeeks
But we need to install some dependencies recommended by vs code, simply click on install in the recommendation as shown below:
You can also download it manually by going to the extension manager and searching “ go “
Try to run the program by pressing “ctrl+f5” . after this vs code may give you some more recommendations to install, simply click on install whenever recommendation is shown.
And finally, you will get this output…
You can visit official GO documentation to learn more about it: