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
1
190
Introdução a Go
Nesta palestra faço uma introdução a linguagem Go
Elton Minetto
May 11, 2022
Tweet
Share
More Decks by Elton Minetto
See All by Elton Minetto
Criando Kubernetes Operators com o operator-sdk
eminetto
0
48
Developer productivity for fun and profit - Enterprise edition
eminetto
0
42
Criando Kubernetes Operators com o operator-sdk
eminetto
0
53
Developer productivity for fun and profit - Developer edition
eminetto
3
440
Observabilidade de APIs
eminetto
1
790
Reflexões sobre Design de Software
eminetto
1
390
Discussões sobre microsserviços
eminetto
0
54
Go, o que, por que e como?
eminetto
0
280
Dev Journey
eminetto
0
410
Other Decks in Programming
See All in Programming
CSC307 Lecture 09
javiergs
PRO
1
500
コード生成を伴うLLMエージェント - 2024.07.18 Tokyo AI
smiyawaki0820
11
4.1k
feature環境をGitHub ActionsとCloudFormationでいい感じに管理する
nealle
2
310
継続的な活動で築く地方エンジニアの道
myamashii
2
350
Activities at Cairo Library
cairolibrary720
0
1.2k
Architectures with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
100
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
190
ドメイン駆動設計の実践
masuda220
PRO
17
5.1k
英語
s_shimotori
1
220
Microservices rules (July 2024) : what good looks like
cer
PRO
0
1.6k
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
17
1.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
42
2.7k
Making the Leap to Tech Lead
cromwellryan
127
8.7k
Code Review Best Practice
trishagee
58
16k
Happy Clients
brianwarren
94
6.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
26
2.1k
Raft: Consensus for Rubyists
vanstee
134
6.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
90
47k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.8k
Ruby is Unlike a Banana
tanoku
96
10k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
78
15k
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