Skip to content

Instantly share code, notes, and snippets.

@ma-9
Created November 13, 2019 19:43
Show Gist options
  • Save ma-9/8e306d89e923089f5226a7f7732db6b5 to your computer and use it in GitHub Desktop.
Save ma-9/8e306d89e923089f5226a7f7732db6b5 to your computer and use it in GitHub Desktop.
A Quick Intro to GoLang

GoLang-Go Programming Language

What is Go ?

Go also known as GoLang, is developed by Google to solve problems they face at google. Go is an Open SOurce Language and highly efficient and scalable for large applications. Go is basically developed to handle massive Class Based programs that runs at Google to provide different kind of services. Before Go, These kind of large scale application problems are handled through C++ or JAVA but after some decades now a days we have lots of new services and devices to be operated with the code. Go has easy constructivity and understadable language that can handle all masive problems that we have to face while developing large scale applications. Go easily handles networking, Clusters, and Cloud COmputing Conflicts.

GoLang

Go was Officially introduced in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson, But Publicly it was released in Nov 2009.

It provides garbage collection, type safety, dynamic-typing capability, many advanced built-in types such as variable length arrays and key-value maps. It also provides a rich standard library.

Lets Run Our Very First Go Program

Lets Write Code

Two Ways to run Go

  1. Using Online Compiler Click Here
  2. Download onto Machine Click Here

Open your favourite IDE and write the code with us

First Go Program

package main The package main package where your write your logic (code)

Import "fmt" Functional Inout Output Packages imported using "Import" Keyword

func main() Here we can write simple function which we want to execute

Now Run the Code by Navigate into the folder using CMD or Terminal and Write the code to execute:

go run programName.go

Running Command to Execute Go

A Go program basically consists of the following parts

  • Package Declaration

  • Import Packages

  • Functions

  • Variables

  • Statements and Expressions

  • Comments

The Biggest Relief for Programmers - there are no , Commas in GO Programming Language

package main

import "fmt"

func main() {
   var x float64
   x = 20.0
   fmt.Println(x)
   fmt.Printf("x is of type %T\n", x)
}

So this is Quick Tutorial on GoLang..

If you like this and want more information and needs a video series on GoLang comment below the video, We will highly give importance to your feedbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment