Skip to content

Suraj-kumar00/go-learnings-with-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Learning Go with building projects

Golang Logo

Why write Go?

  • Programming Language developed at Google 2007
  • Open-sourced in 2009, pretty young lanugage.
  • Go is natively compiled language

Go use cases

  1. Evolution of Infrastructure
  2. Multi-Threading = Do multiple things at once

Challenges of Multi-Threading

  • Multiple users editing the same document

  • Multiple users booking at the same time.And yeah this should work in a way that no double booking happens (Prevent double booking) And this concept is called Concurrency: It's about dealing with lots of things at once.

    Build-in Concurrency Mechanism


  • C++

  • Java

  • Complex code

  • Expensive & slow


  • Go
  • Go was desined to run on multiple cores and built to support concurrency
  • Concurrency in Go is cheap and easy

No build-in Concurrency Mechanism

  • Python
  • Node

Main Use Case of GO:

  • For performant Applications
  • Running on scaled, distributed systems

Characterstics of Go

  1. Simple and readable syntax of a dynamically typed language likePython
  2. Efficiency and safety of lower-level, statically typed language like C++
  3. Server-Side or Backedn language:
  • Mircrosercies
  • Web applications
  • Database services
  1. Technologies that run on Go:
  • Docker
  • Hashicorp Vault
  • Kubernetes
  • Cockroach DB
  • and so on...

Go is becoming more and more popular for writing simple automation applications and cli applications for DevOps and SRE tasks as well.

Execution Speed

In terms of executions speed Go is much faster than:

  • Python
  • JS
  • Ruby
  • PHP Or pretty much any Interpreted language is going to be slower than Go

Compiled

When it comes to compilation speed, Go is much faster than these language.

  • Rust
  • C
  • C++
  • Java
  • C#

VM(Vertual Machine)

Its(Go) execution speed is more similar to these language when it comes to Runtime Speed. A go program tends to use much less memory then:

  • Java
  • C#

How to install Go(Golang) on Ubuntu 22.04 LTS

# update your system
sudo apt update && sudo apt upgrade

# install go
sudo apt install golang-go

Install go extension if you are using VsCode: Extension name: Go official

About

Learning Go with building projects

Topics

Resources

License

Stars

Watchers

Forks