Introduction
Course Objective
Datatypes and variables
Operators and Control Flow
Arrays, Slices and Maps
functions
Pointers
Structs, Method and Interfaces
Why Golang?
It is one of the most popular programming language.
Written in Go Docker and Kubernetes Company uses are Google twitch Uber M Soundcloud daily motion
Introduction and Installation
- Golang created by the engineer at Google.
Go was created to combine:-
The ease of programming of an interpreted, dynamically typed language (Such as Python)
With the efficiency and safety of a statically typed, compiled language. (such as C++)
It also aimed to be modern, with support for networked and multicore computing.
Install Golang
Click on this Golang
Search and download msi file for window.
And open CMD and type go version.
-
Create a folder mkdir workspace and Create a file main.go.
Then Open VS Code Type below code of Hello World.
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
Then Open terminal with shortcut control+shift+`
Type go run main.go
Your first Go Program
package main
Must start with package name in Go Package keywords and then name to make executable program
import fmt
"fmt" Short form for format
main
Special type of function and it is the entry point of the executable programs.
fmt.Println
Dot operator is known as the member access operator used to access member of the package anything in double quote becomes string
Type of Comments
Single line comment
// comment
Multi line comments
/*
mulit
line
*/
That's great if you have make till here you have covered basic of Golang Introduction and Installation with your first go program.
If you liked what you read, do follow and any feedback for further improvement will be highly appreciated!
Thank you and Happy Learning!👏