Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Introdução a Go
Elton Minetto
May 11, 2022
Programming
1
84
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
Reflexões sobre Design de Software
eminetto
1
230
Discussões sobre microsserviços
eminetto
0
13
Go, o que, por que e como?
eminetto
0
160
Dev Journey
eminetto
0
300
Microsserviços usando Go kit
eminetto
0
220
Arquitetura de software e a Clean Architecture
eminetto
5
1k
Da ideia ao Speaker Deck
eminetto
0
180
Por que e como usamos Go na Codenation?
eminetto
1
310
Clean Architecture using Go
eminetto
1
440
Other Decks in Programming
See All in Programming
ちょうぜつ改め21世紀ふつうのソフトウェア設計
tanakahisateru
7
5.9k
はてなリモートインターンシップ2022 フロントエンドブートキャンプ 講義資料
hatena
0
110
eBPF와 함께 이해하는 Cilium 네트워킹
hadaney
3
830
Use KMM to call the API of the National Tax Agency
akkeylab
0
290
様々なWebアプリをAzureにデプロイする
tomokusaba
0
110
ipa-medit: Memory search and patch tool for IPA without Jailbreaking/ipa-medit-bh2022-europe
tkmru
0
120
Zynq MP SoC で楽しむエッジコンピューティング ~RTLプログラミングのススメ~
ryuz88
0
160
Milestoner
bkuhlmann
1
240
GitHub Flowでの高速なデリバリーをささえるテスト基盤について
kyong0612
0
130
量子コンピュータ時代のプログラミングセミナー / 20221222_Amplify_seminar _route_optimization
fixstars
0
240
Form実装基本を学び直してみた
hyugatsukui
0
200
WordPress(再)入門 - 基礎知識・環境編
oleindesign
1
100
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
39
7.8k
Debugging Ruby Performance
tmm1
67
11k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
182
15k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
500
130k
Why Our Code Smells
bkeepers
PRO
326
55k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
44
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
56
2.5k
The Cult of Friendly URLs
andyhume
68
5.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
351
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
396
63k
Mobile First: as difficult as doing things right
swwweet
213
7.8k
Visualization
eitanlees
128
12k
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