SlideShare a Scribd company logo

Introduction to Go

CODE GIST: https://gist.github.com/tyndyll/cce72c16dc112cbe7ffac44dbb1dc5e8 A high level introduction to the Go programming language, including a sample Hello World web server

1 of 22
Download to read offline
Go
Because most times Javascript 

isn’t enough
Simon Hewitt / @tyndyll
caveat emptor
I’m an engineer, not a computer scientist… these are the opinions of someone that has been using Go in production for 5+ years and likes it because it gets stuff done,
not because it is some version of computing purity
What is Go? Go (often referred to
as Golang) is a
statically typed,
compiled
programming
language designed at
Google
– Wikipedia
A definition of Go as a programming language. Static typed, so we are having to declare what type are variables are, and compiled, so that to run our code we need to
use the go compiler to execute the code
Why is Go?
Asking the question Why is Go is important, as the context it was created in, and the problems it was trying to solve explains the rationalisation behind the language and
why some decisions were made
– Rob Pike
“The goals of the Go project were to eliminate the
slowness and clumsiness of software development at
Google, and thereby to make the process more productive
and scalable. The language was designed by and for
people who write—and read and debug and maintain—
large software systems.”
Google was originally created at Google in 2007. According to Rob Pike, one of Go’s authors at his talk at Splash 2012 Google was having issues regarding build speeds,
on boarding developers and drift across their code. His presentation gives a lot of context

https://talks.golang.org/2012/splash.article

His talks are always worth a watch.

The conclusion we can come to is that Go was created, not as a exercise in language design, but rather an attempt to solve software engineering problems.
It must work at scale
It must be familiar, roughly C-like.
It must be modern.
dl.google.com
These are the three conclusions that the Go development team came up with initially. Working at scale refers to both running the software, and to the number and size of
teams. Familiar and C like refers to the fact that Java, C++ and Python were the developers that Google had and were hiring at the time so it had to take that into
account. Must be modern refers to the fact that it was being developed in 2007. At this time Google had been working in the web for a considerable time, and new what
was required for success in this environment - HTTP, cryptography, concurrency and memory protection.

dl.google.com was one of the first services written in Go that was released into production. This services handles all downloads at Google - Chrome, Android, SDKs - so
it is heavily loaded and well tested

Recommended

Developing for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformDeveloping for LinkedIn's Application Platform
Developing for LinkedIn's Application PlatformTaylor Singletary
 
Why you should care about Go (Golang)
Why you should care about Go (Golang)Why you should care about Go (Golang)
Why you should care about Go (Golang)Aaron Schlesinger
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLangNVISIA
 
NodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonNodeJS vs Golang - A detailed comparison
NodeJS vs Golang - A detailed comparisonDevathon
 
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Aniruddha Chakrabarti
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with goVimlesh Sharma
 
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
 [INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno [INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
[INNOVATUBE] Tech Talk #3: Golang - Takaaki MizunoNexus FrontierTech
 

More Related Content

What's hot

[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn [INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn Nexus FrontierTech
 
When, how & why use golang in 2021 go benefits & use cases
When, how & why use golang in 2021  go benefits & use casesWhen, how & why use golang in 2021  go benefits & use cases
When, how & why use golang in 2021 go benefits & use casesKaty Slemon
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventuremylittleadventure
 
0581OS_FM_Final_NT
0581OS_FM_Final_NT0581OS_FM_Final_NT
0581OS_FM_Final_NTVibhor Kumar
 
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 frameworksKaty Slemon
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in GolangMo'ath Qasim
 
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
ATO 2014 - So You Think You Know 'Go'? The Go Programming LanguageATO 2014 - So You Think You Know 'Go'? The Go Programming Language
ATO 2014 - So You Think You Know 'Go'? The Go Programming LanguageJohn Potocny
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.aviSeongJae Park
 
Golang skills session1: introduction
Golang skills session1: introductionGolang skills session1: introduction
Golang skills session1: introductionsofianinho
 
Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?gedoplan
 
Water Softening Of the House Water with the Help of Water Softener Systems
Water Softening Of the House Water with the Help of Water Softener SystemsWater Softening Of the House Water with the Help of Water Softener Systems
Water Softening Of the House Water with the Help of Water Softener SystemsJessica Simpson
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesGiulio De Donato
 
GraphQL - hot or not? How to simplify API based services?
GraphQL - hot or not? How to simplify  API based services?GraphQL - hot or not? How to simplify  API based services?
GraphQL - hot or not? How to simplify API based services?Adam Klimczyk
 
Let's Go @ St. Louis CocoaHeads
Let's Go @ St. Louis CocoaHeadsLet's Go @ St. Louis CocoaHeads
Let's Go @ St. Louis CocoaHeadsPaul Balogh
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)Evan Lin
 
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabRon Munitz
 
New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...
New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...
New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...Vũ Nguyễn
 
The Why of Go
The Why of GoThe Why of Go
The Why of GoC4Media
 

What's hot (20)

[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn [INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
[INNOVATUBE] Tech Talk #3: Golang - Vũ Nguyễn
 
When, how & why use golang in 2021 go benefits & use cases
When, how & why use golang in 2021  go benefits & use casesWhen, how & why use golang in 2021  go benefits & use cases
When, how & why use golang in 2021 go benefits & use cases
 
Golang
GolangGolang
Golang
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventure
 
0581OS_FM_Final_NT
0581OS_FM_Final_NT0581OS_FM_Final_NT
0581OS_FM_Final_NT
 
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
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
ATO 2014 - So You Think You Know 'Go'? The Go Programming LanguageATO 2014 - So You Think You Know 'Go'? The Go Programming Language
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi
 
Golang skills session1: introduction
Golang skills session1: introductionGolang skills session1: introduction
Golang skills session1: introduction
 
Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?Kotlin – Alternative oder Ergänzung zu Java?
Kotlin – Alternative oder Ergänzung zu Java?
 
Water Softening Of the House Water with the Help of Water Softener Systems
Water Softening Of the House Water with the Help of Water Softener SystemsWater Softening Of the House Water with the Help of Water Softener Systems
Water Softening Of the House Water with the Help of Water Softener Systems
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfaces
 
GraphQL - hot or not? How to simplify API based services?
GraphQL - hot or not? How to simplify  API based services?GraphQL - hot or not? How to simplify  API based services?
GraphQL - hot or not? How to simplify API based services?
 
Let's Go @ St. Louis CocoaHeads
Let's Go @ St. Louis CocoaHeadsLet's Go @ St. Louis CocoaHeads
Let's Go @ St. Louis CocoaHeads
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
 
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
 
New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...
New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...
New trends of web technology on mobile: HTML5, PhoneGap & NaCl - Barcamp Saig...
 
The Why of Go
The Why of GoThe Why of Go
The Why of Go
 

Similar to Introduction to Go

Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Codemotion
 
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
 
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 LanguageGanesh Samarthyam
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Ganesh Samarthyam
 
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5Amanda Lam
 
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
 
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
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud FoundryPlatform CF
 
Grails at DMC Digital
Grails at DMC DigitalGrails at DMC Digital
Grails at DMC Digitaltomaslin
 
Introduction to Get Programming Language.docx
Introduction to Get Programming Language.docxIntroduction to Get Programming Language.docx
Introduction to Get Programming Language.docxAnkitaGarg87
 
[2020 git lab commit] continuous infrastructure
[2020 git lab commit] continuous infrastructure[2020 git lab commit] continuous infrastructure
[2020 git lab commit] continuous infrastructureRodrigo Stefani Domingues
 
welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?sangam biradar
 
Introduction to go, and why it's awesome
Introduction to go, and why it's awesomeIntroduction to go, and why it's awesome
Introduction to go, and why it's awesomeJanet Kuo
 

Similar to Introduction to Go (20)

Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Enterprise 2020
Enterprise 2020Enterprise 2020
Enterprise 2020
 
Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
 
Untangling4
Untangling4Untangling4
Untangling4
 
Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016Getting started with go - Florin Patan - Codemotion Milan 2016
Getting started with go - Florin Patan - Codemotion Milan 2016
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
 
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
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
 
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 ...
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud Foundry
 
Grails at DMC Digital
Grails at DMC DigitalGrails at DMC Digital
Grails at DMC Digital
 
Introduction to Get Programming Language.docx
Introduction to Get Programming Language.docxIntroduction to Get Programming Language.docx
Introduction to Get Programming Language.docx
 
Comparing C and Go
Comparing C and GoComparing C and Go
Comparing C and Go
 
[2020 git lab commit] continuous infrastructure
[2020 git lab commit] continuous infrastructure[2020 git lab commit] continuous infrastructure
[2020 git lab commit] continuous infrastructure
 
welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?
 
Introduction to go, and why it's awesome
Introduction to go, and why it's awesomeIntroduction to go, and why it's awesome
Introduction to go, and why it's awesome
 

Recently uploaded

maximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsmaximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsssuser82c38d
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20Shane Coughlan
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)GDSCNiT
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfssuser82c38d
 
Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Jeffrey Haguewood
 
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTSi-engage
 
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ..."Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...ISPMAIndia
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkTimothy Spann
 
Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Asher Sterkin
 
LLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flowLLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flowNaoki (Neo) SATO
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetMatthewTHawley
 
Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...Flexsin
 
AI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriAI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriISPMAIndia
 
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdfAUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdfAutokey
 
Sql server types of joins with example.pptx
Sql server types of joins with example.pptxSql server types of joins with example.pptx
Sql server types of joins with example.pptxsameer gaikwad
 
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이ssuser82c38d
 
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A..."Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...ISPMAIndia
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementISPMAIndia
 
No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!Anthony Dahanne
 
Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...
Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...
Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...ISPMAIndia
 

Recently uploaded (20)

maximum subarray ppt for killing camp students
maximum subarray ppt for killing camp studentsmaximum subarray ppt for killing camp students
maximum subarray ppt for killing camp students
 
OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20OpenChain AI Study Group - North America and Europe - 2024-02-20
OpenChain AI Study Group - North America and Europe - 2024-02-20
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
 
killingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdfkillingcamp longest common subsequence.pdf
killingcamp longest common subsequence.pdf
 
Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)Automation for Bonterra Impact Management (fka Apricot)
Automation for Bonterra Impact Management (fka Apricot)
 
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
100 TOOLS TO MEASURE AND ANALYSE YOUR DIGITAL MARKETING EFFORTS
 
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ..."Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
"Taking an idea to a Product in Health diagnostics" by Dr. Geetha Manjunath, ...
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
 
Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024Essence of Requirements Engineering: Pragmatic Insights for 2024
Essence of Requirements Engineering: Pragmatic Insights for 2024
 
LLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flowLLMOps with Azure Machine Learning prompt flow
LLMOps with Azure Machine Learning prompt flow
 
P1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 SmartsheetP1 Inspection Types in Municity 5 Smartsheet
P1 Inspection Types in Municity 5 Smartsheet
 
Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...Software Testing life cycle (STLC) Importance, Phases, Benefits...
Software Testing life cycle (STLC) Importance, Phases, Benefits...
 
AI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit BendigiriAI Product Management by Abhijit Bendigiri
AI Product Management by Abhijit Bendigiri
 
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdfAUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
AUTOKEYUNLOCKER-BRANDS-SUPPORT-STANDARD-VERSION.pdf
 
Sql server types of joins with example.pptx
Sql server types of joins with example.pptxSql server types of joins with example.pptx
Sql server types of joins with example.pptx
 
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
killingcamp 광고삽입문제 풀이, killingcamp 광고삽입문제 풀이
 
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A..."Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
"Discovery and Delivery through Product IntelliGenAI framework" by Ramkumar A...
 
SPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product ManagementSPM 2024 – Overview of and benefits of AI in Product Management
SPM 2024 – Overview of and benefits of AI in Product Management
 
No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!
 
Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...
Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...
Product Manager vs Product Owner – Why Do Companies Still Struggle 23 Years A...
 

Introduction to Go

  • 1. Go Because most times Javascript isn’t enough Simon Hewitt / @tyndyll
  • 2. caveat emptor I’m an engineer, not a computer scientist… these are the opinions of someone that has been using Go in production for 5+ years and likes it because it gets stuff done, not because it is some version of computing purity
  • 3. What is Go? Go (often referred to as Golang) is a statically typed, compiled programming language designed at Google – Wikipedia A definition of Go as a programming language. Static typed, so we are having to declare what type are variables are, and compiled, so that to run our code we need to use the go compiler to execute the code
  • 4. Why is Go? Asking the question Why is Go is important, as the context it was created in, and the problems it was trying to solve explains the rationalisation behind the language and why some decisions were made
  • 5. – Rob Pike “The goals of the Go project were to eliminate the slowness and clumsiness of software development at Google, and thereby to make the process more productive and scalable. The language was designed by and for people who write—and read and debug and maintain— large software systems.” Google was originally created at Google in 2007. According to Rob Pike, one of Go’s authors at his talk at Splash 2012 Google was having issues regarding build speeds, on boarding developers and drift across their code. His presentation gives a lot of context https://talks.golang.org/2012/splash.article His talks are always worth a watch. The conclusion we can come to is that Go was created, not as a exercise in language design, but rather an attempt to solve software engineering problems.
  • 6. It must work at scale It must be familiar, roughly C-like. It must be modern. dl.google.com These are the three conclusions that the Go development team came up with initially. Working at scale refers to both running the software, and to the number and size of teams. Familiar and C like refers to the fact that Java, C++ and Python were the developers that Google had and were hiring at the time so it had to take that into account. Must be modern refers to the fact that it was being developed in 2007. At this time Google had been working in the web for a considerable time, and new what was required for success in this environment - HTTP, cryptography, concurrency and memory protection. dl.google.com was one of the first services written in Go that was released into production. This services handles all downloads at Google - Chrome, Android, SDKs - so it is heavily loaded and well tested
  • 7. What is Go? So lets look at some Go
  • 8. This is the code we are going to be looking at. It’s a simple Hello World application, but it is a web server, with some concurrency built in, so that when a request to say hello comes in, it will return, but also pass the request through to a Printer service The code and more comments and commentary, including how to execute and build the code, will be found at https://gist.github.com/tyndyll/cce72c16dc112cbe7ffac44dbb1dc5e8
  • 9. This slide shows packages and how they are imported. This `main` package is the entry point to the program. The two packages imported, `fmt` and `net/http` are part of the standard library. The lower code snippets show how external packages are imported. These are pulled by using the built in tool `go get`, which will clone code from a repository. This repository can be public or private. Once imported, the packages would be available as `alexa.TypeName`. For more see https://tour.golang.org/basics/1
  • 10. This is a demonstration of how structs are implemented. See the gist for further details https://gist.github.com/tyndyll/cce72c16dc112cbe7ffac44dbb1dc5e8
  • 11. What if I want to log? This is a demonstration of how interfaces are implemented. The interface declares that this interface is satisfied by any struct that has a `Print(string)` function. There are no additional keywords such as implements. Also note that there are no public or private keywords. This is because this is implemented in go by making functions and types that have a capital letter Public, and functions and types with a lower case letter private. Something else of interest - if the developer decides that simply printing the string is not enough and they want a timestamped log entry instead, they can import the log by adding it to the import statement above, and changing the fmt on line 15 to log. However, this will not compile. One of the features of Go is that it demands that unused code is removed. This is in response to the problem of non required dependencies existing, and causing confusion in future development. Removing the fmt package would allow the file to compile again See the gist for further details, including an additional implementation of a Printer https://gist.github.com/tyndyll/cce72c16dc112cbe7ffac44dbb1dc5e8
  • 12. This is where all of the action happens. As in many programming languages, main is the programs entry point. See the gist for further commentary https://gist.github.com/tyndyll/cce72c16dc112cbe7ffac44dbb1dc5e8
  • 13. Why Should You Care? So we’ve seen Go, so why should we pick it up in 2019?
  • 14. Squillions of Dollars Can’t Be Wrong* * This is a terrible reason
  • 15. This page lists a number of companies and products that are using Go heavily. This is not to indicate that writing in Go will create a billion dollar unicorn, but more to demonstrate that many types of products (networking, APIs, tooling, databases, smart contracts) are being developed and heavily used in production across the industry
  • 16. Similarly, with our Belfast focus, these are companies locally that are using Go everyday. Learning Go isn’t niche, and there are jobs and opportunities available
  • 17. Tooling • Built in Libraries • Built in tools… • Testing • Deployment Tooling is one of the primary features of Go, and it’s one of the reasons that Go is scalable across teams. Aside from the fantastic standard library (https://golang.org/ pkg/), Go has a huge number of tools as part of the distribution (https://golang.org/cmd/). The standout is gofmt, which formats code into the Right Way. This makes Go code extremely readable no matter what team has written it. go test is also built in, which makes testing a first class component of Go. Deployment is interesting also. Go is a compiled language, producing a single binary with all libraries statically compiled into it. Compiling for different platforms or architectures is as simple as setting the GOOS (darwin, linux, windows) or GOARCH (386, amd64, arm etc) environmental variables respectively. There is more information in the `Compiling` section of the gist. Also of interest - Go is now available as AWS Lambdas or Google Cloud Functions, as well as being an ideal candidate for docker containers.
  • 18. Learning and Support •Tiny base language •Decisions made for you •Good docs •IDE’s •Helpful community •Playground •Fast development cycle I believe that Go makes an excellent teaching language, and as such is easy to pick up (25 keywords with a fully populated standard library). While static typing may seem more complicated than dynamic typing, the compiler is helpful in its error messages. Go is opinionated, deciding what the style of code should be and enforcing it both through gofmt and the compiler. You may have strong opinions about where curly braces should be placed, but Go really doesn’t care. This is enforced through the compiler, for example, by not requiring semi colons to terminate statements and only accepting newlines or braces. The docs are great, and are locally available in the distribution by executing godoc -http :6060 (makes them available in a browser on port 6060). They are also built into your code in a similar way to Javadocs (https://blog.golang.org/godoc-documenting-go-code) Recommended IDE’s Goland - https://www.jetbrains.com/go/ VS Code - https://code.visualstudio.com/docs/languages/go If you want to just dabble rather than setting everything up have a look at Golang Playground http://play.golang.org What can’t be underestimated is the fast compile times. Compiling even large projects takes seconds, to the point where running `go run code.go` makes for a really good scripting environment
  • 19. So It’s Perfect? Well… • Dependencies are complicated • Generics • Error handling These are currently being actively addressed by the community I could explain these, but it’s easier to go straight to the source. The community is getting better at discussing their issues in public and using the community to help Dependencies issues and conversation - https://github.com/golang/go/wiki/Modules Generics issue and conversation - https://go.googlesource.com/proposal/+/master/design/go2draft-generics-overview.md Error handling - https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md
  • 20. • Easy to pick up • Scales to Teams • Feature packed standard library • Fantastic Tooling • Good community • 2.0 is coming So Why Go? Summing everything up
  • 21. • Web services • Networking services • Command line tools • Glue… • Multi platform • Lambda/Cloud Functions So When Go? When would you use it? Ironically on the morning of the talk Garth Gilmour (https://twitter.com/GarthGilmour) retweeted this https://twitter.com/GarthGilmour/status/1084760622397575168 If you want to try Go, it’s design makes this really straightforward. Download and install, and get started. Everything is possible in a single file, managing dependencies is straightforward, if it is required (again, you can go far on the standard library alone). If you have a simple idea for anything like the above, I strongly encourage you to give Go a look. If I can help, my Twitter handle is on the next slide With regard to “Glue” above. Using C libraries in Go is pretty straightforward. If you have something you need a C library for, why not wrap it in Go? https://blog.golang.org/c-go-cgo
  • 22. GOTO • https://tour.golang.org/ • https://gobyexample.com • Belfast Gophers • Training? • @tyndyll on Twitter Twitter is the easiest place to find me