Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introdução a Go
Search
Elton Minetto
May 11, 2022
Programming
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introdução a Go
Nesta palestra faço uma introdução a linguagem Go
Elton Minetto
May 11, 2022
More Decks by Elton Minetto
See All by Elton Minetto
Criando Kubernetes Operators com o operator-sdk
eminetto
0
170
Developer productivity for fun and profit - Enterprise edition
eminetto
0
120
Criando Kubernetes Operators com o operator-sdk
eminetto
0
160
Developer productivity for fun and profit - Developer edition
eminetto
3
560
Observabilidade de APIs
eminetto
1
1k
Reflexões sobre Design de Software
eminetto
1
520
Discussões sobre microsserviços
eminetto
0
170
Go, o que, por que e como?
eminetto
0
390
Dev Journey
eminetto
0
510
Other Decks in Programming
See All in Programming
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
130
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
440
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
580
React本体のコードリーディング
high_g_engineer
1
160
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
250
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
650
源内ハンズオン概要編
hideg
0
220
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
37
23k
Go 1.27 における memory allocation の高速化
andpad
0
350
高専キャリア LT 発表内容
crysta1221
4
4.3k
バグを直したら useEffect が消えた
colorful12
3
770
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
180
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Deep Space Network (abreviated)
tonyrice
0
270
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Fireside Chat
paigeccino
42
4k
Transcript
Introdução a Go
Elton Minetto ๏ Escrevo códigos, sou professor, palestrante, e escritor
๏ Escrevo no https://eltonminetto.dev e no twitter ๏ Sou Principal Software Engineer no PicPay
O que é?
Uma linguagem open source
None
Por que uma nova linguagem?
Muitos problemas com software em grande escala
Velocidade de compilação
Sistemas distribuídos Multicore
Objetivos
Semântica simples
Tipagem estática
Programação concorrente
Divertida!
TALK IS CHEAP, SHOW ME THE CODE!
Pacotes package main import ( "fmt" "math" ) func main()
{ fmt.Printf("Now you have %g problems.", math.Sqrt(7)) }
Resultados Múltiplos package main import "fmt" func swap(x, y string)
(string, string) { return y, x } func main() { a, b := swap("hello", "world") fmt.Println(a, b) }
Erros package main import "github.com/coderockr/nfe/transmitter" func main() { response, err
:= transmitter.transmit(nfe, xml) if err != nil { panic("Error ") //tratamento de erro qualquer } result, err := transmitter.saveData(response, xml) if err != nil { panic("Error ") //tratamento de erro qualquer } }
Goroutines package main import ( "fmt" "time" ) func say(s
string) { for i := 0; i < 5; i++ { time.Sleep(100 * time.Millisecond) fmt.Println(s) } } func main() { go say("world") say("hello") }
Canais package main import "fmt" func sum(s []int, c chan
int) { sum := 0 for _, v := range s { sum += v } c <- sum // send sum to c } func main() { s := []int{7, 2, 8, -9, 4, 0} c := make(chan int) go sum(s[:len(s)/2], c) go sum(s[len(s)/2:], c) x, y := <-c, <-c // receive from c fmt.Println(x, y, x+y) }
Cross Compilation GOOS=darwin GOARCH=amd64 go build gorotines.go GOOS=windows GOARCH=amd64 go
build gorotines.go GOOS=linux GOARCH=amd64 go build gorotines.go
OO via composição e não herança, biblioteca padrão poderosa, etc.
Quem está usando?
Google, Basecamp, Globo.com, Canonical, DigitalOcean, Dropbox, Github, Heroku, Medium, Docker,
MongoDB, Mozilla, Netflix, New Relic, New York Times, Resultados Digitais, Moip, Neoway, Walmart, Trybe, PicPay, etc https://github.com/golang/go/wiki/GoUsers
Aplicações
APIs
Microservices
IoT
Databases
CLIents
Material de estudo
Site oficial Tour Go, por onde começar? Livro: A Linguagem
de Programação Go Curso Desenvolvimento Web com Go Awesome Go
Contato
[email protected]
http://eltonminetto.dev http://twitter.com/eminetto