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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Elton Minetto
May 11, 2022
Programming
290
1
Share
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
150
Developer productivity for fun and profit - Enterprise edition
eminetto
0
93
Criando Kubernetes Operators com o operator-sdk
eminetto
0
140
Developer productivity for fun and profit - Developer edition
eminetto
3
530
Observabilidade de APIs
eminetto
1
1k
Reflexões sobre Design de Software
eminetto
1
500
Discussões sobre microsserviços
eminetto
0
140
Go, o que, por que e como?
eminetto
0
360
Dev Journey
eminetto
0
490
Other Decks in Programming
See All in Programming
実践CRDT
tamadeveloper
0
460
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
190
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
150
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
350
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
460
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
260
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
3
710
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
「速くなった気がする」をデータで疑う
senleaf24
0
170
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
520
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
9
5.6k
Featured
See All Featured
Accessibility Awareness
sabderemane
0
99
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
120
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
240
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
110
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
270
GraphQLとの向き合い方2022年版
quramy
50
15k
Site-Speed That Sticks
csswizardry
13
1.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
790
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Become a Pro
speakerdeck
PRO
31
5.9k
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