SlideShare a Scribd company logo
David Robert
david.robert@elo7.com
Tech Talk Elo7
August/2015
Go is an open source
programming language
that makes it easy to
build simple, reliable, and
efficient software
What is Go?
https://golang.org
has big, so big problems!
Which (big) problems?
❏ Hardware is big and the software is big
❏ There are many millions of lines of software
❏ Servers mostly in C++ and lots of Java and Python
❏ Thousands of engineers work on the code
❏ And of course, all this software runs on zillions of
machines.
In short, development at
is big, can be slow, and is often
clumsy. But it is effective.
''
''
https://talks.golang.org/2012/splash.article
A lot of others people
help to bring go from
prototype to reality.
Go became a public
Open Source
project.
https://golang.org/doc/faq#history
2008 2009 20102007
Starts to have
adoption by other
programmers
Started and built by
Robert Griesemer,
Rob Pike and Ken
Thompson as a
part-time project.
History
❏ Ken Thompson (B, C, Unix, UTF-8)
❏ Rob Pike (Unix, UTF-8)
❏ Robert Griesemer (Hotspot, JVM)
...and a few others engineers at Google
2013 20142012
Version history
Go 1.4 (December)
Go 1.3 (June)
Go 1 (March)
Go 1.2 (December)
Go 1.1 (May)
https://golang.org/project/
❏ Eliminate slowness
❏ Eliminate clumsiness
❏ Improve productive
❏ Maintain (and improve) scale
It was designed by and for people who write, read,
debug and maintain large software systems.
Go's purpose is not to do research programming
language design.
Go's purpose is to make its designers' programming
lives better.
Why Go?
Go is a compiled, concurrent,
garbage-collected, statically typed
language developed at .
What is Go?
fix, fmt, get, install, list, tool,
version, vet.
build compile packages and dependencies
run compile and run Go program
clean remove object files
env print Go environment information
test test packages and benchmarks
Go is a tool for managing Go source code...
Mainly tools:
Others tools:
https://github.com/golang/go/wiki/GoUsers
❏ Compiled
❏ Garbage-collected
❏ Has your own runtime
❏ Simple syntax
❏ Great standard library
❏ Cross-platform
❏ Object Oriented (without inheritance)
❏ Statically and stronger typed
❏ Concurrent (goroutines)
❏ Closures
❏ Explicity dependencies
❏ Multiple return values
❏ Pointers
❏ and so on...
What will you see in Go?
Have not been implemented in
favor of efficiency.
❏ Exception handling
❏ Inheritance
❏ Generics
❏ Assert
❏ Method overload
What will you not
see in Go?
see a bit of code!
Packages
❏ Each Go program are compound per packages
❏ Programs starts from main package
❏ This example are using the ftm and math packages
$ go run packages.go
My favorite number is 1
❏ The var instruction declares a list of variables
❏ The type is informed at the end
❏ The var instruction could be in a package or in a function
❏ The var instruction could includes initializers, 1 per variable. In
this case, the type could be ommited because it will be inferred
Variables
$ go run variables.go
0 false false false
$ go run variables-with-initiali
1 2 true false no!
❏ Inside a function, the short attribution instruction :=
can be used instead of a var declaration
Short variables declarations
$ go run short-variable-declarations.go
1 2 3 true false no!
$ go run constants.go
Hello world! Happy 3.14 Day! Go rules?
true
❏ Constants are declared like variables but with keyword const
❏ Can not use the syntx :=
Constants
Functions
❏ Functions could have zero or more arguments
❏ Notice that the type comes after the parameter name,
like variables
$ go run functions.go
55
❏ A function can have multiple return values
Multiple return values
$ go run multiple-results.go
world hello
❏ Go has just for as looping structure
❏ It is very similar with C or Java code, except for ( )
❏ Start and end declarations can be empty
Looping For
$ go run for.go
45
$ go run for-continu
1024
$ go run for-is-go-while.go
1024
❏ Semicolon can be removed and you will have while
❏ for can run forever
Looping "while" and forever
$ go run forever.go
process took too long
❏ It is very similar with C or Java code, except for ( )
if Condition
$ go run if.go
1.4142135623730951 2i
$ go run switch.go
Go runs on nacl.
❏ It is very similar with C or Java code, except for ( )
Switch Condition
$ go run defer.go
hello world
Defer
❏ Postponing the execution of a function until the function returns
❏ The arguments of the deferred calls are evaluated immediately
What more?
❏ Pointer
❏ Struct
❏ Matrix
❏ Slice
❏ Range
❏ Map
❏ Value function
❏ Closures
❏ Method
❏ Interface
❏ Stringer
❏ Error
❏ and a lot of more!!!
http://go-tour-br.appspot.com
$ go run http.go
A web server
❏ It is just simple to build a web server with 15 lines or less!!
Could you belive that???
❏ To execute a goroutine, just go!
❏ To send or receive information between the
goroutines, use channels
❏ Use the GOMAXPROCS environment variable to
define the amount of threads
Concurrency (goroutines)
$ go run goroutines.go
hello
world
hello
world
hello
world
hello
world
hello
❏ A goroutine is a lightweight thread managed by Go runtime
Goroutines
$ go run channels.go
17 -5 12
Channels
❏ Channels are typed's conduit through which you can send and receive
values with the channel operator <-
Unbuffered Channels
http://www.goinggo.net/2014/02/the-nature-of-channels-in-go.html
c := make (chan int)
Buffered Channels
http://www.goinggo.net/2014/02/the-nature-of-channels-in-go.html
c := make (chan int, 10)
Now you are ready to
!
Bibliografia
❏ http://golang.org
❏ http://go-tour-br.appspot.com/
❏ https://tour.golang.org
❏ http://www.golangbr.org/
❏ https://vimeo.com/49718712
❏ http://gophercon.com
❏ http://www.infoq.com/br/news/2014/09/go-1-3
❏ http://www.casadocodigo.com.br/products/livro-google-go
❏ https://pt.wikipedia.org/wiki/Inferno_(sistema_operacional)
❏ http://www.grokpodcast.com/series/a-linguagem-go/
❏ https://pt.wikipedia.org/wiki/Go_(linguagem_de_programação)
❏ https://gobyexample.com
❏ http://www.goinggo.net/2014/02/the-nature-of-channels-in-go.html
❏ http://www.goinggo.net/2013/09/detecting-race-conditions-with-go.html?m=1
❏ https://en.wikipedia.org/wiki/Green_threads
❏ http://www.toptal.com/go/go-programming-a-step-by-step-introductory-tutorial
Questions?

More Related Content

What's hot

Golang
GolangGolang
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
Spandana Govindgari
 
Golang
GolangGolang
Golang
Felipe Mamud
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal Mohan N
 
Golang getting started
Golang getting startedGolang getting started
Golang getting started
Harshad Patil
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
ShubhamMishra485
 
Concurrency With Go
Concurrency With GoConcurrency With Go
Concurrency With Go
John-Alan Simmons
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
Go lang
Go langGo lang
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
Wei-Ning Huang
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
Markus Schneider
 
Go Programming Language by Google
Go Programming Language by GoogleGo Programming Language by Google
Go Programming Language by Google
Uttam Gandhi
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
NVISIA
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
Basil N G
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
Mo'ath Qasim
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in Golang
Oliver N
 
Golang Template
Golang TemplateGolang Template
Golang Template
Karthick Kumar
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
Tzar Umang
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
Ishin Vin
 
Goroutines and Channels in practice
Goroutines and Channels in practiceGoroutines and Channels in practice
Goroutines and Channels in practice
Guilherme Garnier
 

What's hot (20)

Golang
GolangGolang
Golang
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Golang
GolangGolang
Golang
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Golang getting started
Golang getting startedGolang getting started
Golang getting started
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Concurrency With Go
Concurrency With GoConcurrency With Go
Concurrency With Go
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Go lang
Go langGo lang
Go lang
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
Go Programming Language by Google
Go Programming Language by GoogleGo Programming Language by Google
Go Programming Language by Google
 
Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in Golang
 
Golang Template
Golang TemplateGolang Template
Golang Template
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
 
Goroutines and Channels in practice
Goroutines and Channels in practiceGoroutines and Channels in practice
Goroutines and Channels in practice
 

Similar to An introduction to programming in Go

go language- haseeb.pptx
go language- haseeb.pptxgo language- haseeb.pptx
go language- haseeb.pptx
ArsalanMaqsood1
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
olracoatalub
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
Cherimay Batallones
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
C4Media
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
mark-asoi
 
My final requirement
My final requirementMy final requirement
My final requirement
katrinaguevarra29
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
Ron Barabash
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
aprilyyy
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di Persio
CodeFest
 
TDD in Python With Pytest
TDD in Python With PytestTDD in Python With Pytest
TDD in Python With Pytest
Eddy Reyes
 
Fuzzing - Part 2
Fuzzing - Part 2Fuzzing - Part 2
Fuzzing - Part 2
UTD Computer Security Group
 
A philosophy of software design
A philosophy of software designA philosophy of software design
A philosophy of software design
Diego Pacheco
 
2CPP02 - C++ Primer
2CPP02 - C++ Primer2CPP02 - C++ Primer
2CPP02 - C++ Primer
Michael Heron
 
Go Revel Gooo...
Go Revel Gooo...Go Revel Gooo...
Go Revel Gooo...
Dmytro Ovcharenko
 
API Design
API DesignAPI Design
API Design
Tim Boudreau
 
Amazon builder Library notes
Amazon builder Library notesAmazon builder Library notes
Amazon builder Library notes
Diego Pacheco
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
Simon Hewitt
 
How go makes us faster (May 2015)
How go makes us faster (May 2015)How go makes us faster (May 2015)
How go makes us faster (May 2015)
Wilfried Schobeiri
 
Golang
GolangGolang
Golang
Saray Chak
 
10 reasons to be excited about go
10 reasons to be excited about go10 reasons to be excited about go
10 reasons to be excited about go
Dvir Volk
 

Similar to An introduction to programming in Go (20)

go language- haseeb.pptx
go language- haseeb.pptxgo language- haseeb.pptx
go language- haseeb.pptx
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
 
My final requirement
My final requirementMy final requirement
My final requirement
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di Persio
 
TDD in Python With Pytest
TDD in Python With PytestTDD in Python With Pytest
TDD in Python With Pytest
 
Fuzzing - Part 2
Fuzzing - Part 2Fuzzing - Part 2
Fuzzing - Part 2
 
A philosophy of software design
A philosophy of software designA philosophy of software design
A philosophy of software design
 
2CPP02 - C++ Primer
2CPP02 - C++ Primer2CPP02 - C++ Primer
2CPP02 - C++ Primer
 
Go Revel Gooo...
Go Revel Gooo...Go Revel Gooo...
Go Revel Gooo...
 
API Design
API DesignAPI Design
API Design
 
Amazon builder Library notes
Amazon builder Library notesAmazon builder Library notes
Amazon builder Library notes
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
How go makes us faster (May 2015)
How go makes us faster (May 2015)How go makes us faster (May 2015)
How go makes us faster (May 2015)
 
Golang
GolangGolang
Golang
 
10 reasons to be excited about go
10 reasons to be excited about go10 reasons to be excited about go
10 reasons to be excited about go
 

More from David Robert Camargo de Campos

Evolução cultural - Criando Times de Alto Desempenho
Evolução cultural - Criando Times de Alto DesempenhoEvolução cultural - Criando Times de Alto Desempenho
Evolução cultural - Criando Times de Alto Desempenho
David Robert Camargo de Campos
 
Evolução cultural - Criando times de alto desempenho
Evolução cultural - Criando times de alto desempenhoEvolução cultural - Criando times de alto desempenho
Evolução cultural - Criando times de alto desempenho
David Robert Camargo de Campos
 
Introdução ao kotlin
Introdução ao kotlinIntrodução ao kotlin
Introdução ao kotlin
David Robert Camargo de Campos
 
O uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
O uso de PWA e o futuro do desenvolvimento mobile com React Native e KotlinO uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
O uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
David Robert Camargo de Campos
 
Evolução cultural: Criando times de alto desempenho no Elo7
Evolução cultural: Criando times de alto desempenho no Elo7Evolução cultural: Criando times de alto desempenho no Elo7
Evolução cultural: Criando times de alto desempenho no Elo7
David Robert Camargo de Campos
 
Cultura na engenharia & Impacto no recrutamento
Cultura na engenharia & Impacto no recrutamentoCultura na engenharia & Impacto no recrutamento
Cultura na engenharia & Impacto no recrutamento
David Robert Camargo de Campos
 
Os desafios de um chat integrado ao checkout
Os desafios de um chat integrado ao checkoutOs desafios de um chat integrado ao checkout
Os desafios de um chat integrado ao checkout
David Robert Camargo de Campos
 
Times de Alta Performance
Times de Alta PerformanceTimes de Alta Performance
Times de Alta Performance
David Robert Camargo de Campos
 
Programando em Go
Programando em GoProgramando em Go
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
David Robert Camargo de Campos
 
Como um grande sistema REST funciona - arquitetura e desempenho
Como um grande sistema REST funciona - arquitetura e desempenhoComo um grande sistema REST funciona - arquitetura e desempenho
Como um grande sistema REST funciona - arquitetura e desempenho
David Robert Camargo de Campos
 
Implementação, design ou arquitetura?
Implementação, design ou arquitetura?Implementação, design ou arquitetura?
Implementação, design ou arquitetura?
David Robert Camargo de Campos
 
Construindo um sistema distribuido usando rest
Construindo um sistema distribuido usando restConstruindo um sistema distribuido usando rest
Construindo um sistema distribuido usando rest
David Robert Camargo de Campos
 
Como um grande sistema REST funciona
Como um grande sistema REST funcionaComo um grande sistema REST funciona
Como um grande sistema REST funciona
David Robert Camargo de Campos
 
Dojo abril
Dojo abrilDojo abril
Dicas para deixar seu código mais Robusto
Dicas para deixar seu código mais RobustoDicas para deixar seu código mais Robusto
Dicas para deixar seu código mais Robusto
David Robert Camargo de Campos
 
Robustez de Software - Como ouvir menos reclamações dos seus chefes
Robustez de Software - Como ouvir menos reclamações dos seus chefesRobustez de Software - Como ouvir menos reclamações dos seus chefes
Robustez de Software - Como ouvir menos reclamações dos seus chefes
David Robert Camargo de Campos
 

More from David Robert Camargo de Campos (17)

Evolução cultural - Criando Times de Alto Desempenho
Evolução cultural - Criando Times de Alto DesempenhoEvolução cultural - Criando Times de Alto Desempenho
Evolução cultural - Criando Times de Alto Desempenho
 
Evolução cultural - Criando times de alto desempenho
Evolução cultural - Criando times de alto desempenhoEvolução cultural - Criando times de alto desempenho
Evolução cultural - Criando times de alto desempenho
 
Introdução ao kotlin
Introdução ao kotlinIntrodução ao kotlin
Introdução ao kotlin
 
O uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
O uso de PWA e o futuro do desenvolvimento mobile com React Native e KotlinO uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
O uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
 
Evolução cultural: Criando times de alto desempenho no Elo7
Evolução cultural: Criando times de alto desempenho no Elo7Evolução cultural: Criando times de alto desempenho no Elo7
Evolução cultural: Criando times de alto desempenho no Elo7
 
Cultura na engenharia & Impacto no recrutamento
Cultura na engenharia & Impacto no recrutamentoCultura na engenharia & Impacto no recrutamento
Cultura na engenharia & Impacto no recrutamento
 
Os desafios de um chat integrado ao checkout
Os desafios de um chat integrado ao checkoutOs desafios de um chat integrado ao checkout
Os desafios de um chat integrado ao checkout
 
Times de Alta Performance
Times de Alta PerformanceTimes de Alta Performance
Times de Alta Performance
 
Programando em Go
Programando em GoProgramando em Go
Programando em Go
 
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
 
Como um grande sistema REST funciona - arquitetura e desempenho
Como um grande sistema REST funciona - arquitetura e desempenhoComo um grande sistema REST funciona - arquitetura e desempenho
Como um grande sistema REST funciona - arquitetura e desempenho
 
Implementação, design ou arquitetura?
Implementação, design ou arquitetura?Implementação, design ou arquitetura?
Implementação, design ou arquitetura?
 
Construindo um sistema distribuido usando rest
Construindo um sistema distribuido usando restConstruindo um sistema distribuido usando rest
Construindo um sistema distribuido usando rest
 
Como um grande sistema REST funciona
Como um grande sistema REST funcionaComo um grande sistema REST funciona
Como um grande sistema REST funciona
 
Dojo abril
Dojo abrilDojo abril
Dojo abril
 
Dicas para deixar seu código mais Robusto
Dicas para deixar seu código mais RobustoDicas para deixar seu código mais Robusto
Dicas para deixar seu código mais Robusto
 
Robustez de Software - Como ouvir menos reclamações dos seus chefes
Robustez de Software - Como ouvir menos reclamações dos seus chefesRobustez de Software - Como ouvir menos reclamações dos seus chefes
Robustez de Software - Como ouvir menos reclamações dos seus chefes
 

Recently uploaded

Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 

Recently uploaded (20)

Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 

An introduction to programming in Go

  • 2. Go is an open source programming language that makes it easy to build simple, reliable, and efficient software What is Go? https://golang.org
  • 3. has big, so big problems!
  • 4. Which (big) problems? ❏ Hardware is big and the software is big ❏ There are many millions of lines of software ❏ Servers mostly in C++ and lots of Java and Python ❏ Thousands of engineers work on the code ❏ And of course, all this software runs on zillions of machines.
  • 5. In short, development at is big, can be slow, and is often clumsy. But it is effective. '' '' https://talks.golang.org/2012/splash.article
  • 6. A lot of others people help to bring go from prototype to reality. Go became a public Open Source project. https://golang.org/doc/faq#history 2008 2009 20102007 Starts to have adoption by other programmers Started and built by Robert Griesemer, Rob Pike and Ken Thompson as a part-time project. History
  • 7. ❏ Ken Thompson (B, C, Unix, UTF-8) ❏ Rob Pike (Unix, UTF-8) ❏ Robert Griesemer (Hotspot, JVM) ...and a few others engineers at Google
  • 8. 2013 20142012 Version history Go 1.4 (December) Go 1.3 (June) Go 1 (March) Go 1.2 (December) Go 1.1 (May) https://golang.org/project/
  • 9. ❏ Eliminate slowness ❏ Eliminate clumsiness ❏ Improve productive ❏ Maintain (and improve) scale It was designed by and for people who write, read, debug and maintain large software systems. Go's purpose is not to do research programming language design. Go's purpose is to make its designers' programming lives better. Why Go?
  • 10. Go is a compiled, concurrent, garbage-collected, statically typed language developed at . What is Go?
  • 11. fix, fmt, get, install, list, tool, version, vet. build compile packages and dependencies run compile and run Go program clean remove object files env print Go environment information test test packages and benchmarks Go is a tool for managing Go source code... Mainly tools: Others tools:
  • 13. ❏ Compiled ❏ Garbage-collected ❏ Has your own runtime ❏ Simple syntax ❏ Great standard library ❏ Cross-platform ❏ Object Oriented (without inheritance) ❏ Statically and stronger typed ❏ Concurrent (goroutines) ❏ Closures ❏ Explicity dependencies ❏ Multiple return values ❏ Pointers ❏ and so on... What will you see in Go?
  • 14. Have not been implemented in favor of efficiency. ❏ Exception handling ❏ Inheritance ❏ Generics ❏ Assert ❏ Method overload What will you not see in Go?
  • 15. see a bit of code!
  • 16. Packages ❏ Each Go program are compound per packages ❏ Programs starts from main package ❏ This example are using the ftm and math packages $ go run packages.go My favorite number is 1
  • 17. ❏ The var instruction declares a list of variables ❏ The type is informed at the end ❏ The var instruction could be in a package or in a function ❏ The var instruction could includes initializers, 1 per variable. In this case, the type could be ommited because it will be inferred Variables $ go run variables.go 0 false false false $ go run variables-with-initiali 1 2 true false no!
  • 18. ❏ Inside a function, the short attribution instruction := can be used instead of a var declaration Short variables declarations $ go run short-variable-declarations.go 1 2 3 true false no!
  • 19. $ go run constants.go Hello world! Happy 3.14 Day! Go rules? true ❏ Constants are declared like variables but with keyword const ❏ Can not use the syntx := Constants
  • 20. Functions ❏ Functions could have zero or more arguments ❏ Notice that the type comes after the parameter name, like variables $ go run functions.go 55
  • 21. ❏ A function can have multiple return values Multiple return values $ go run multiple-results.go world hello
  • 22. ❏ Go has just for as looping structure ❏ It is very similar with C or Java code, except for ( ) ❏ Start and end declarations can be empty Looping For $ go run for.go 45 $ go run for-continu 1024
  • 23. $ go run for-is-go-while.go 1024 ❏ Semicolon can be removed and you will have while ❏ for can run forever Looping "while" and forever $ go run forever.go process took too long
  • 24. ❏ It is very similar with C or Java code, except for ( ) if Condition $ go run if.go 1.4142135623730951 2i
  • 25. $ go run switch.go Go runs on nacl. ❏ It is very similar with C or Java code, except for ( ) Switch Condition
  • 26. $ go run defer.go hello world Defer ❏ Postponing the execution of a function until the function returns ❏ The arguments of the deferred calls are evaluated immediately
  • 27. What more? ❏ Pointer ❏ Struct ❏ Matrix ❏ Slice ❏ Range ❏ Map ❏ Value function ❏ Closures ❏ Method ❏ Interface ❏ Stringer ❏ Error ❏ and a lot of more!!! http://go-tour-br.appspot.com
  • 28. $ go run http.go A web server ❏ It is just simple to build a web server with 15 lines or less!! Could you belive that???
  • 29. ❏ To execute a goroutine, just go! ❏ To send or receive information between the goroutines, use channels ❏ Use the GOMAXPROCS environment variable to define the amount of threads Concurrency (goroutines)
  • 30. $ go run goroutines.go hello world hello world hello world hello world hello ❏ A goroutine is a lightweight thread managed by Go runtime Goroutines
  • 31. $ go run channels.go 17 -5 12 Channels ❏ Channels are typed's conduit through which you can send and receive values with the channel operator <-
  • 34. Now you are ready to !
  • 35. Bibliografia ❏ http://golang.org ❏ http://go-tour-br.appspot.com/ ❏ https://tour.golang.org ❏ http://www.golangbr.org/ ❏ https://vimeo.com/49718712 ❏ http://gophercon.com ❏ http://www.infoq.com/br/news/2014/09/go-1-3 ❏ http://www.casadocodigo.com.br/products/livro-google-go ❏ https://pt.wikipedia.org/wiki/Inferno_(sistema_operacional) ❏ http://www.grokpodcast.com/series/a-linguagem-go/ ❏ https://pt.wikipedia.org/wiki/Go_(linguagem_de_programação) ❏ https://gobyexample.com ❏ http://www.goinggo.net/2014/02/the-nature-of-channels-in-go.html ❏ http://www.goinggo.net/2013/09/detecting-race-conditions-with-go.html?m=1 ❏ https://en.wikipedia.org/wiki/Green_threads ❏ http://www.toptal.com/go/go-programming-a-step-by-step-introductory-tutorial