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
240
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
100
Developer productivity for fun and profit - Enterprise edition
eminetto
0
63
Criando Kubernetes Operators com o operator-sdk
eminetto
0
100
Developer productivity for fun and profit - Developer edition
eminetto
3
490
Observabilidade de APIs
eminetto
1
900
Reflexões sobre Design de Software
eminetto
1
450
Discussões sobre microsserviços
eminetto
0
98
Go, o que, por que e como?
eminetto
0
310
Dev Journey
eminetto
0
450
Other Decks in Programming
See All in Programming
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
50
32k
XP, Testing and ninja testing
m_seki
3
220
Goで作る、開発・CI環境
sin392
0
190
#QiitaBash MCPのセキュリティ
ryosukedtomita
0
760
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
710
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
120
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
660
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
21
3.8k
ふつうの技術スタックでアート作品を作ってみる
akira888
0
310
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
520
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
1.1k
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
610
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
The Invisible Side of Design
smashingmag
300
51k
Building Adaptive Systems
keathley
43
2.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
800
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
720
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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