SlideShare a Scribd company logo
An Introduction to Go
Imesh Gunaratne
Product Lead, WSO2 Private PaaS
Committer & PMC Member, Apache Stratos
Why Google started Go?
● No major systems language has emerged in over a
decade
● Computers are enormously quicker but software
development is not faster
● C tradition header file based dependency management is
much cleaner and faster in compilation
● Dynamically typed languages such as Python, JS are much
easier to use
● Fundamental concepts such as garbage collection &
parallel computation were not supported well in
popular system languages
https://golang.org/doc/faq
Why Google started Go?
● None of the system languages were providing following
three aspects in one:
○ Efficient compilation
○ Efficient execution
○ Ease of programming
● Go is an attempt to combine the ease of programming of
an interpreted, dynamically typed language with the
efficiency and safety of a statically typed, compiled
language.
https://golang.org/doc/faq
Go ancestors
● Mostly in the C family (basic syntax)
● Input from Python, JS
● Significant input from Pascal/Modula/Oberon family
(declarations, packages)
● Ideas from CSP style languages Newsqueak, Limbo
(concurrency)
In every respect it’s a new language built by thinking what
programmers do and how to make programming much
efficient and more fun!
https://golang.org/doc/faq
Go = C + Python + JS
It’s more like C with Python/JS style syntax
What Go provides?
● A systems programming language
● Compiled, directly compile into binary like C
● Binary is platform specific
● Statically typed, but support dynamic declarations
● No virtual machine like in Java
● No exception handling, uses multi-value returns
● No classes, use structs with functions
● Not object oriented, but has support for interfaces, more
like functional programming
● CSP-style concurrent programming
● Provides garbage collection
https://en.wikipedia.org/wiki/Go_(programming_language)
Advantages of Go
● Fast compilation, a large program compiles in seconds
● Type system has no hierarchy, so no time is spent
defining the relationships between types
● Improved dependency analysis compared to C-style
include files
● Fully garbage collected
● Fundamental support for concurrent execution &
communication
● Designed to implement system software to be run on
multi-core machines
https://golang.org/doc/faq
Say Hello World in Go
Constructs & Syntax
Hello world
https://gobyexample.com/hello-world
Standard Constructs
Most common constructs used in other languages
Variables
https://gobyexample.com/variables
Values
https://gobyexample.com/values
Functions
https://gobyexample.com/functions
If/Else
https://gobyexample.com/if-else
For
https://gobyexample.com/for
Switch
https://gobyexample.com/switch
Map
https://gobyexample.com/map
Variadic functions
https://gobyexample.com/variadic-functions
Pointers
https://gobyexample.com/pointers
Structs
https://gobyexample.com/structs
Go Specific Constructs
Constructs introduced in Go
Multiple return values
https://gobyexample.com/multiple-return-values
Closures
https://gobyexample.com/closures
Range (for each)
http://stackoverflow.com/questions/7782411/is-there-a-foreach-in-go
Slices
https://gobyexample.com/slices
Goroutines
https://gobyexample.com/goroutines
Channels
https://gobyexample.com/channels
References
● Golang FAQ:
https://golang.org/doc/faq
● Go, Wikipedia:
https://en.wikipedia.org/wiki/Go_(programming_language)
● Communicating Sequential Processes (CSP), Wikipedia:
https://en.wikipedia.org/wiki/Communicating_sequential_processes
● Static typing, Wikipedia:
https://en.wikipedia.org/wiki/Type_system#Static_typing
● Dynamic programming language, Wikipedia:
https://en.wikipedia.org/wiki/Dynamic_programming_language
● Variadic function, Wikipedia:
https://en.wikipedia.org/wiki/Variadic_function
● Closure, Wikipedia:
https://en.wikipedia.org/wiki/Closure_(computer_programming)

More Related Content

PPT
A First Look at Google's Go Programming Language
PPT
Introduction to Go-Lang
PDF
An introduction to go programming language
PDF
PDF
The Go programming language - Intro by MyLittleAdventure
PPTX
Evolution or stagnation programming languages
PPTX
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
PPTX
Golang (Go Programming Language)
A First Look at Google's Go Programming Language
Introduction to Go-Lang
An introduction to go programming language
The Go programming language - Intro by MyLittleAdventure
Evolution or stagnation programming languages
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
Golang (Go Programming Language)

What's hot (20)

PDF
Why you should care about Go (Golang)
PPT
Google Go! language
PDF
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
PDF
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
PDF
Go language presentation
PPTX
Introduction to go lang
PDF
Coding with golang
PPTX
Go Programming language, golang
PPTX
Comparing C and Go
PPTX
PDF
Building Command Line Tools with Golang
PDF
Quality Assurance in PostgreSQL
PPTX
Golang - Overview of Go (golang) Language
PDF
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
PDF
Go Programming Language by Google
PDF
Growing up new PostgreSQL developers (pgcon.org 2018)
PDF
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
PPTX
Go Language presentation
PDF
Golang from Scala developer’s perspective
Why you should care about Go (Golang)
Google Go! language
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Go language presentation
Introduction to go lang
Coding with golang
Go Programming language, golang
Comparing C and Go
Building Command Line Tools with Golang
Quality Assurance in PostgreSQL
Golang - Overview of Go (golang) Language
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Go Programming Language by Google
Growing up new PostgreSQL developers (pgcon.org 2018)
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
Go Language presentation
Golang from Scala developer’s perspective
Ad

Similar to An Introduction to Go (20)

PPT
Google's Go Programming Language - Introduction
PDF
Lets Go - An introduction to Google's Go Programming Language
PDF
Let's Go: Introduction to Google's Go Programming Language
PDF
Introduction to go, and why it's awesome
PDF
Introduction to Go
PDF
Introduction to Programming in Go
PDF
Introduction to Google's Go programming language
PDF
The GO programming language
PPTX
Golang workshop - Mindbowser
PPT
Introduction to Go ProgrammingLanguage.ppt
PPTX
Ready, set, go! An introduction to the Go programming language
PDF
Golang : A Hype or the Future?
PDF
GoLang Introduction
PDF
Go Within Cloud Foundry
PPTX
The GO Language : From Beginners to Gophers
ODP
Ready to go
PDF
Inroduction to golang
PPTX
Golang introduction
PPTX
Golang 101 (Concurrency vs Parallelism)
PDF
Golang
Google's Go Programming Language - Introduction
Lets Go - An introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
Introduction to go, and why it's awesome
Introduction to Go
Introduction to Programming in Go
Introduction to Google's Go programming language
The GO programming language
Golang workshop - Mindbowser
Introduction to Go ProgrammingLanguage.ppt
Ready, set, go! An introduction to the Go programming language
Golang : A Hype or the Future?
GoLang Introduction
Go Within Cloud Foundry
The GO Language : From Beginners to Gophers
Ready to go
Inroduction to golang
Golang introduction
Golang 101 (Concurrency vs Parallelism)
Golang
Ad

More from Imesh Gunaratne (20)

PDF
Planning WSO2 Deployments on Pivotal Cloud Foundry
PDF
Planning WSO2 Deployments on DC/OS
PDF
Deep Dive into Kubernetes - Part 2
PDF
Deep Dive into Kubernetes - Part 1
PDF
WSO2 Container Strategy
PDF
WSO2 API Manager Reference Architecture for DC/OS
PDF
WSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
PDF
WSO2 Kubernetes Reference Architecture - Nov 2017
PDF
WSO2 Cloud and Platform as a Service Strategy
PDF
Planning Your Cloud Strategy
PDF
Deploying WSO2 Middleware on Containers
PDF
Multitenancy in WSO2 Carbon 5 (C5)
PDF
Deploying WSO2 Middleware on Mesos
PDF
Deploying WSO2 Middleware on Kubernetes
PDF
Service Oriented Architecture & Beyond
PDF
Docker for Java Developers
PDF
WSO2 Cloud Strategy Update
PDF
Scale into Multi-Cloud with Containers
PDF
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
PDF
Making a Better World with Technology Innovations
Planning WSO2 Deployments on Pivotal Cloud Foundry
Planning WSO2 Deployments on DC/OS
Deep Dive into Kubernetes - Part 2
Deep Dive into Kubernetes - Part 1
WSO2 Container Strategy
WSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for Pivotal Cloud Foundry
WSO2 Kubernetes Reference Architecture - Nov 2017
WSO2 Cloud and Platform as a Service Strategy
Planning Your Cloud Strategy
Deploying WSO2 Middleware on Containers
Multitenancy in WSO2 Carbon 5 (C5)
Deploying WSO2 Middleware on Mesos
Deploying WSO2 Middleware on Kubernetes
Service Oriented Architecture & Beyond
Docker for Java Developers
WSO2 Cloud Strategy Update
Scale into Multi-Cloud with Containers
Revolutionizing WSO2 PaaS with Kubernetes & App Factory
Making a Better World with Technology Innovations

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
NewMind AI Monthly Chronicles - July 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence

An Introduction to Go