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

PDF
Go language presentation
PPTX
Go Programming language, golang
PDF
Introduction to Go programming language
PDF
PDF
Golang 101
PDF
Golang and Eco-System Introduction / Overview
PDF
Why you should care about Go (Golang)
PPTX
Golang - Overview of Go (golang) Language
Go language presentation
Go Programming language, golang
Introduction to Go programming language
Golang 101
Golang and Eco-System Introduction / Overview
Why you should care about Go (Golang)
Golang - Overview of Go (golang) Language

What's hot (20)

PDF
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
PDF
Golang
PPTX
Best Practices in Handling Performance Issues
PPT
PPTX
Introduction to Node.js
PPTX
JavaScript Lecture notes.pptx
PPTX
JavaScript Promises
PPTX
JavaScript Engines and Event Loop
PPTX
Golang (Go Programming Language)
PPTX
Type Casting Operator
PPTX
advance-dart.pptx
PPT
Présentation jQuery pour débutant
PPTX
PHP Cookies and Sessions
PDF
Original slides from Ryan Dahl's NodeJs intro talk
PDF
Treinamento: como usar o JMeter, interpretar resultados e otimizar a execução
PDF
The Design of Blockchain-Based Apps (DApps)
PDF
Load Testing - How to Stress Your Odoo with Locust
PDF
Why and how to develop OpenERP test scenarios (in python and using OERPScenar...
PPTX
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
PPTX
Mikroprogramlanmis kontrol
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
Golang
Best Practices in Handling Performance Issues
Introduction to Node.js
JavaScript Lecture notes.pptx
JavaScript Promises
JavaScript Engines and Event Loop
Golang (Go Programming Language)
Type Casting Operator
advance-dart.pptx
Présentation jQuery pour débutant
PHP Cookies and Sessions
Original slides from Ryan Dahl's NodeJs intro talk
Treinamento: como usar o JMeter, interpretar resultados e otimizar a execução
The Design of Blockchain-Based Apps (DApps)
Load Testing - How to Stress Your Odoo with Locust
Why and how to develop OpenERP test scenarios (in python and using OERPScenar...
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Mikroprogramlanmis kontrol
Ad

Similar to An introduction to programming in Go (20)

PPTX
go language- haseeb.pptx
PPT
Introduction to Go ProgrammingLanguage.ppt
PPTX
Introduction to go lang
PPT
A First Look at Google's Go Programming Language
PPT
Google's Go Programming Language - Introduction
PPTX
Golang introduction
PDF
Introduction to Go
PPTX
PPTX
Go fundamentals
PPTX
Lab1GoBasicswithgo_foundationofgolang.pptx
PDF
Inroduction to golang
PDF
Introduction to Programming in Go
PDF
Introduction to go, and why it's awesome
PPTX
Google GO
PDF
The GO programming language
PDF
Golang
PDF
Coding in GO - GDG SL - NSBM
PDF
GoLang Introduction
PDF
go language- haseeb.pptx
Introduction to Go ProgrammingLanguage.ppt
Introduction to go lang
A First Look at Google's Go Programming Language
Google's Go Programming Language - Introduction
Golang introduction
Introduction to Go
Go fundamentals
Lab1GoBasicswithgo_foundationofgolang.pptx
Inroduction to golang
Introduction to Programming in Go
Introduction to go, and why it's awesome
Google GO
The GO programming language
Golang
Coding in GO - GDG SL - NSBM
GoLang Introduction
Ad

More from David Robert Camargo de Campos (17)

PDF
Evolução cultural - Criando Times de Alto Desempenho
PDF
Evolução cultural - Criando times de alto desempenho
PDF
Introdução ao kotlin
PDF
O uso de PWA e o futuro do desenvolvimento mobile com React Native e Kotlin
PDF
Evolução cultural: Criando times de alto desempenho no Elo7
PDF
Cultura na engenharia & Impacto no recrutamento
PDF
Os desafios de um chat integrado ao checkout
PDF
Times de Alta Performance
PDF
PDF
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
PDF
Como um grande sistema REST funciona - arquitetura e desempenho
PDF
Implementação, design ou arquitetura?
PDF
Construindo um sistema distribuido usando rest
PPT
Como um grande sistema REST funciona
PDF
Dicas para deixar seu código mais Robusto
PDF
Robustez de Software - Como ouvir menos reclamações dos seus chefes
Evolução cultural - Criando Times de Alto Desempenho
Evolução cultural - Criando times de alto desempenho
Introdução ao 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
Cultura na engenharia & Impacto no recrutamento
Os desafios de um chat integrado ao checkout
Times de Alta Performance
Lidando com Java obsoleto: do Struts 1.0 ao CDI - QConSP 2014
Como um grande sistema REST funciona - arquitetura e desempenho
Implementação, design ou arquitetura?
Construindo um sistema distribuido usando rest
Como um grande sistema REST funciona
Dicas para deixar seu código mais Robusto
Robustez de Software - Como ouvir menos reclamações dos seus chefes

Recently uploaded (20)

PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
top salesforce developer skills in 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Introduction to Artificial Intelligence
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
wealthsignaloriginal-com-DS-text-... (1).pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Design an Analysis of Algorithms II-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
Softaken Excel to vCard Converter Software.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Upgrade and Innovation Strategies for SAP ERP Customers
top salesforce developer skills in 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Digital Strategies for Manufacturing Companies
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Introduction to Artificial Intelligence
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Choose the Right IT Partner for Your Business in Malaysia
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

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