SlideShare a Scribd company logo
z
Golang
M Dineshkumar
Software Developer
z
History
 Design began in late 2007.
 Key players:
 Robert Griesemer, Rob Pike, Ken Thompson
 Later: Ian Lance Taylor, Russ Cox
 Became open source in November 2009.
 Developed entirely in the open; very active community.
 Language stable as of Go 1, early 2012.
z
Go at Google
 Go is a programming language designed by Google to help
solve Google's problems.
 Google has big problems.
Big Hardware
z
Big software
 C++ (mostly) for servers, plus lots of Java and Python
 thousands of engineers
 gazillions of lines of code
 distributed build system
 And of course:
 zillions of machines, which we treat as a modest number of
compute clusters
 Development at Google can be slow, often clumsy.
z
The reason for Go
Goals:
 eliminate slowness
 eliminate clumsiness
 improve effectiveness
 maintain (even improve) scale
 Go was designed by and for people who write, read, debug and
maintain—large software systems.
 Go's purpose is not research into programming language design.
 Go's purpose is to make its designers' programming lives better.
z
Who uses?
z
What is Go?
Go is:
 open source
 concurrent
 garbage-collected
 efficient
 scalable
 simple
 fun
 boring (to some)
http://golang.org
z
Compiler
 Go is a compiled language, and it has two main compilers, gc
and Gccgo.
z
Purpose
 Efficient compilation
 Efficient execution
 Ease of programming.
z
Go’s ancestors
z
Golang's characteristics
 Goroutine
A Goroutine has a 2kB stack and grow by allocating and freeing
heap storage as required by the program. While threads in other
languages starts with 1MB of storage which is 500 times more than
the stack size of a goroutine.
z
Golang's characteristics
 Concurrency
One of Golang's strongest characteristics is its concurrency.
Concurrency is often confused to be the same as parallelism.
Parallelism is to do many things at once, while concurrency is to
handle many things at once.
z
Golang's characteristics
 Error handling
Many Go-users have been complaining about is how strict the
compiler is about unused variables and packages. The program
wont be compiled if one variable or package is unused forcing the
programmer to have tidy code and maximizing storage usage.
z
Golang's characteristics
 Cgo
Go has a tool called cgo that makes it possible for programs written
in Go to call into C and C++ and in those programs the C or C++
can call back into Go. But there is no support for C or C++ to call
directly to go meaning this does not work for programs that starts
execution in C or C++.
z
Golangs characteristics
 Generics
Generics is a subject that is well discussed in Go. This is something
that is not exactly supported because Go was designed with
simplicity in mind and generics was thought of to be too complex.
There is actually three generic data types in Golang:
Arrays
Slices
Maps
z
Golangs characteristics
 Interfaces
Interfaces in Go works as interfaces in other programming
languages like for example Java, except that you can make use of
the empty interface in Go.
z
Empty Interface
z
Syntax and quirks
 Compilation
In most Go source code files, semicolons won’t be found. This is
because there is no need for the programmer to type them out
since the compiler parses the source code and inserts semicolons
on its own. This makes compilation a bit slower, but the code more
cleaner looking.
z
 Functions
In Go multiple values of same type can be defined as "(x,y int)“.
This means that x and y are two inputs to the function add with the
type int. The text next to the input variables are the output or
returned values of the function. There is something called "naked
returns" in Golang, which is a return followed by nothing. This is
possible due to the naming of the returned value and it’s type in the
declaration of the function.
z
 Pointers in Go
Since Go is built to resemble C and C++, the pointer syntax too is
very similar. A simple example would be seen in example. In the
example it can be seen how the value of the original structure can
be changed by the pointer without dereferencing the pointer.
For example, in C p->x is equivalent to (*p).x and in Golang the
dereferencing is not needed and simply p.x will give the wanted
result.
z
Hello World Example
 A Go program basically consists of the following parts:
 Package Declaration
 Import Packages
 Functions
 Variables
 Statements and Expressions
 Comments
z
z
Executing a Go Program
 Open a text editor and add the above-mentioned code.
 Save the file as hello.go
 Open the command prompt.
 Go to the directory where you saved the file.
 Type go run hello.go and press enter to run your code.
 If there are no errors in your code, then you will see "Hello
World!" printed on the screen.
z
Leaning GO
 Types
 Variables
 Function
 Control Structure
 Object Oriented
 Concurrency
z
Type
 Basic Type
 Boolean
 String
 Byte
 Float
 Constants
z
Type
 Composite Type
 Arrays
 Slices
 Maps
 Structs
 JSONS
 Text and HTML template
z
Variables
z
Static Type Declaration in Go
z
Dynamic Type Declaration
z
Mixed Variable Declaration in Go
z
Constants
z
Arrays
z
Slice
z
Maps
z
Pointers
z
Control Structure
z
Function
z
Function
z
Function
z
Function
z
Object Oriented
 Structs
 Methods
 Interfaces
z
Struct
z
Struct
z
Struct
z
Methods
z
Interface
z
Concurrency
 Goroutine
 Channel
 Select
z
Goroutine
z
Channel
z
Channel
z
Select
In Go language, the select statement is just like switch statement, but in the select
statement, case statement refers to communication, i.e. sent or receive operation on
the channel.
z
This Photo by Unknown Author is licensed under
CC BY-NC-ND

More Related Content

What's hot

Golang
GolangGolang
Golang
Felipe Mamud
 
Go, meet Lua
Go, meet LuaGo, meet Lua
Go, meet Lua
Andre Burgaud
 
2#Kotlin programming tutorials(data types and hello world)
2#Kotlin programming tutorials(data types and hello world)2#Kotlin programming tutorials(data types and hello world)
2#Kotlin programming tutorials(data types and hello world)
Naveen Davis
 
Golang 101
Golang 101Golang 101
Golang 101
宇 傅
 
Golang
GolangGolang
Dot net
Dot netDot net
Dot net
sd00711
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
Taylor Singletary
 
Golang, Future of Programming Language.
Golang, Future of Programming Language.Golang, Future of Programming Language.
Golang, Future of Programming Language.
Sunil Yadav
 
GO programming language
GO programming languageGO programming language
GO programming language
tung vu
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32
OpenEBS
 
Doxygen - Source Code Documentation Generator Tool
Doxygen -  Source Code Documentation Generator ToolDoxygen -  Source Code Documentation Generator Tool
Doxygen - Source Code Documentation Generator Tool
Guo Albert
 
How to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id esHow to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id es
Aurélien Pupier
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
Ary Borenszweig
 
C vs c++
C vs c++C vs c++
C vs c++
ZTE Nepal
 
The GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldThe GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation World
Radina Matic
 
Graph ql api gateway
Graph ql api gatewayGraph ql api gateway
Graph ql api gateway
AnastasiiaPanchenko3
 
Dart presentation
Dart presentationDart presentation
Dart presentation
Lucas Leal
 

What's hot (17)

Golang
GolangGolang
Golang
 
Go, meet Lua
Go, meet LuaGo, meet Lua
Go, meet Lua
 
2#Kotlin programming tutorials(data types and hello world)
2#Kotlin programming tutorials(data types and hello world)2#Kotlin programming tutorials(data types and hello world)
2#Kotlin programming tutorials(data types and hello world)
 
Golang 101
Golang 101Golang 101
Golang 101
 
Golang
GolangGolang
Golang
 
Dot net
Dot netDot net
Dot net
 
Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application Platform
 
Golang, Future of Programming Language.
Golang, Future of Programming Language.Golang, Future of Programming Language.
Golang, Future of Programming Language.
 
GO programming language
GO programming languageGO programming language
GO programming language
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32
 
Doxygen - Source Code Documentation Generator Tool
Doxygen -  Source Code Documentation Generator ToolDoxygen -  Source Code Documentation Generator Tool
Doxygen - Source Code Documentation Generator Tool
 
How to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id esHow to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id es
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
C vs c++
C vs c++C vs c++
C vs c++
 
The GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldThe GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation World
 
Graph ql api gateway
Graph ql api gatewayGraph ql api gateway
Graph ql api gateway
 
Dart presentation
Dart presentationDart presentation
Dart presentation
 

Similar to Golang introduction

Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
Ganesh Samarthyam
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
Mindfire LLC
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
Ganesh Samarthyam
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
Simon Hewitt
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspective
Sveta Bozhko
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
Vimlesh Sharma
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal Mohan N
 
Comparing C and Go
Comparing C and GoComparing C and Go
Comparing C and Go
Marcin Pasinski
 
Go programing language
Go programing languageGo programing language
Go programing language
Ramakrishna kapa
 
5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development
NelsonSEO
 
How golang is an object oriented language.
How golang is an object oriented language.How golang is an object oriented language.
How golang is an object oriented language.
Katy Slemon
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
Equaleyes Solutions Ltd.
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
Katy Slemon
 
Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...
Katy Slemon
 
Why Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For AllWhy Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For All
Katy Slemon
 
Golang nuts (by Nii Nai at DevCongress 2013)
Golang nuts (by Nii Nai at DevCongress 2013)Golang nuts (by Nii Nai at DevCongress 2013)
Golang nuts (by Nii Nai at DevCongress 2013)
DevCongress
 
Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023
SofiaCarter4
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
Devathon
 
Golang job support.pptx
Golang job support.pptxGolang job support.pptx
Golang job support.pptx
GSAIdigitalmarketing
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io
 

Similar to Golang introduction (20)

Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspective
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Comparing C and Go
Comparing C and GoComparing C and Go
Comparing C and Go
 
Go programing language
Go programing languageGo programing language
Go programing language
 
5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development
 
How golang is an object oriented language.
How golang is an object oriented language.How golang is an object oriented language.
How golang is an object oriented language.
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
 
Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...
 
Why Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For AllWhy Golang? Settling the Debate Once and For All
Why Golang? Settling the Debate Once and For All
 
Golang nuts (by Nii Nai at DevCongress 2013)
Golang nuts (by Nii Nai at DevCongress 2013)Golang nuts (by Nii Nai at DevCongress 2013)
Golang nuts (by Nii Nai at DevCongress 2013)
 
Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023Golang Vs NodeJS: Which One To Choose For Your 2023
Golang Vs NodeJS: Which One To Choose For Your 2023
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparison
 
Golang job support.pptx
Golang job support.pptxGolang job support.pptx
Golang job support.pptx
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
 

Recently uploaded

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 

Recently uploaded (20)

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 

Golang introduction

  • 2. z History  Design began in late 2007.  Key players:  Robert Griesemer, Rob Pike, Ken Thompson  Later: Ian Lance Taylor, Russ Cox  Became open source in November 2009.  Developed entirely in the open; very active community.  Language stable as of Go 1, early 2012.
  • 3. z Go at Google  Go is a programming language designed by Google to help solve Google's problems.  Google has big problems.
  • 5. z Big software  C++ (mostly) for servers, plus lots of Java and Python  thousands of engineers  gazillions of lines of code  distributed build system  And of course:  zillions of machines, which we treat as a modest number of compute clusters  Development at Google can be slow, often clumsy.
  • 6. z The reason for Go Goals:  eliminate slowness  eliminate clumsiness  improve effectiveness  maintain (even improve) scale  Go was designed by and for people who write, read, debug and maintain—large software systems.  Go's purpose is not research into programming language design.  Go's purpose is to make its designers' programming lives better.
  • 8. z What is Go? Go is:  open source  concurrent  garbage-collected  efficient  scalable  simple  fun  boring (to some) http://golang.org
  • 9. z Compiler  Go is a compiled language, and it has two main compilers, gc and Gccgo.
  • 10. z Purpose  Efficient compilation  Efficient execution  Ease of programming.
  • 12. z Golang's characteristics  Goroutine A Goroutine has a 2kB stack and grow by allocating and freeing heap storage as required by the program. While threads in other languages starts with 1MB of storage which is 500 times more than the stack size of a goroutine.
  • 13. z Golang's characteristics  Concurrency One of Golang's strongest characteristics is its concurrency. Concurrency is often confused to be the same as parallelism. Parallelism is to do many things at once, while concurrency is to handle many things at once.
  • 14. z Golang's characteristics  Error handling Many Go-users have been complaining about is how strict the compiler is about unused variables and packages. The program wont be compiled if one variable or package is unused forcing the programmer to have tidy code and maximizing storage usage.
  • 15. z Golang's characteristics  Cgo Go has a tool called cgo that makes it possible for programs written in Go to call into C and C++ and in those programs the C or C++ can call back into Go. But there is no support for C or C++ to call directly to go meaning this does not work for programs that starts execution in C or C++.
  • 16. z Golangs characteristics  Generics Generics is a subject that is well discussed in Go. This is something that is not exactly supported because Go was designed with simplicity in mind and generics was thought of to be too complex. There is actually three generic data types in Golang: Arrays Slices Maps
  • 17. z Golangs characteristics  Interfaces Interfaces in Go works as interfaces in other programming languages like for example Java, except that you can make use of the empty interface in Go.
  • 19. z Syntax and quirks  Compilation In most Go source code files, semicolons won’t be found. This is because there is no need for the programmer to type them out since the compiler parses the source code and inserts semicolons on its own. This makes compilation a bit slower, but the code more cleaner looking.
  • 20. z  Functions In Go multiple values of same type can be defined as "(x,y int)“. This means that x and y are two inputs to the function add with the type int. The text next to the input variables are the output or returned values of the function. There is something called "naked returns" in Golang, which is a return followed by nothing. This is possible due to the naming of the returned value and it’s type in the declaration of the function.
  • 21. z  Pointers in Go Since Go is built to resemble C and C++, the pointer syntax too is very similar. A simple example would be seen in example. In the example it can be seen how the value of the original structure can be changed by the pointer without dereferencing the pointer. For example, in C p->x is equivalent to (*p).x and in Golang the dereferencing is not needed and simply p.x will give the wanted result.
  • 22. z Hello World Example  A Go program basically consists of the following parts:  Package Declaration  Import Packages  Functions  Variables  Statements and Expressions  Comments
  • 23. z
  • 24. z Executing a Go Program  Open a text editor and add the above-mentioned code.  Save the file as hello.go  Open the command prompt.  Go to the directory where you saved the file.  Type go run hello.go and press enter to run your code.  If there are no errors in your code, then you will see "Hello World!" printed on the screen.
  • 25. z Leaning GO  Types  Variables  Function  Control Structure  Object Oriented  Concurrency
  • 26. z Type  Basic Type  Boolean  String  Byte  Float  Constants
  • 27. z Type  Composite Type  Arrays  Slices  Maps  Structs  JSONS  Text and HTML template
  • 42. z Object Oriented  Structs  Methods  Interfaces
  • 52. z Select In Go language, the select statement is just like switch statement, but in the select statement, case statement refers to communication, i.e. sent or receive operation on the channel.
  • 53. z This Photo by Unknown Author is licensed under CC BY-NC-ND

Editor's Notes

  1. 2007- Started as a part-time project 2008 – A lot of other people help them to bring go from prototype to reality. 2009 – Go become a public opensource project 2010 – Programmers starts to adopt go.
  2. Google has two tremendous problems. One of them is compile time. Back in the 1980’s, reasonable sized projects took hours to do a clean build. Google’s other problem is string processing. Google reads and analyzes a lot of web pages, which are text files. They do a lot of string manipulation, so it pays for this to be really efficient.
  3. Go is designed for quick compilation without the need for dependency checking, so it addresses the build pain. Google built a rich library of string functions into Go, Garbage collecting makes strings in Go simple to think about, and efficient in ways some other string libraries are not (I’m talking to you, C++ committee).
  4. Opensource in 2009  in concurrent systems, multiple actions can be in progress (may not be executed) at the same time multiple actions are simultaneously executed in parallel systems.
  5. The other compiler, Gccgo, has a front end that is written in C++, and a back end that is coupled to the standard GCC compiler. This allows Go to use interoperability with both C and C++ using the extern "C". The Go team has written two different compilers that implement that spec: gc and gccgo. Gc is the standard compiler, and the go tool uses it by default. it was originally written in C, but as of Go 1.5 it is now written in Go. Gccgo , has a front end that is written in C++ and a back end that is coupled to the standard GCC compiler. This allows Go to use interoperability with both C and C++ using the extern "C". Compared to gc, gccgo is slower to compile code but supports more powerful optimizations, so a CPU-bound program built by gccgo will usually run faster.
  6. Developers at Google wanted a good scalable language when working with large systems, and the developer had to choose either between efficient compilation, efficient execution or ease of programming. The developers at Google found that there was no mainstream programming language that consisted of all these three. So the purpose of Go(Golang) is trying to combine all these three into one language
  7. Go has inherited most of it’s basic syntax from C and C++ but with imports and packages instead of includes like in the C languages. There are a few other programming languages that it has inherited ideas from as well, such as Pascal, Modula and Oberon, and also Limbo from where it got it’s concurrency features. Even though Go has resemblances with other programming languages it’s a completely new language, with the main feature being making normal programming more efficient.
  8. In Golang a goroutine is what in Java would be called a thread. Goroutines are light weight threads, because their memory consumption is minimal compared to the language it has used its inspiration from, C and C++. A Goroutine has a 2kB stack and grow by allocating and freeing heap storage as required by the program. While threads in other languages starts with 1MB of storage which is 500 times more than the stack size of a goroutine. An example of go’s superiority is a server handling connecting clients. The server would create a thread for each incoming connection which would eventually lead to a OutOfMemoryError. Goroutines which takes uses very little memory would not face this problem. This is a problem with every programming language that uses OS threads as a way to handle concurrency.
  9. These are data types which can be instantiated on arbitrary element types. But there is a way to go around the needs of generics, and that is to use something called interfaces. Interfaces define behavior without requiring implementation details.
  10. For example, if you write a function with the empty interface as a parameter this function will work for any type of that parameter.
  11. Another handy thing implemented for pointers is that, if you directly print the pointer, it will print and show which values it’s pointing to but with & before the values. Dereferencing that pointer would end with same result but no & in front of the pointed value.