Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
180
Developer productivity for fun and profit - Enterprise edition
eminetto
0
120
Criando Kubernetes Operators com o operator-sdk
eminetto
0
170
Developer productivity for fun and profit - Developer edition
eminetto
3
560
Observabilidade de APIs
eminetto
1
1.1k
Reflexões sobre Design de Software
eminetto
1
530
Discussões sobre microsserviços
eminetto
0
170
Go, o que, por que e como?
eminetto
0
400
Dev Journey
eminetto
0
510
Other Decks in Programming
See All in Programming
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
340
AIに “答え“を書かせるのを やめてみた
___akari11
0
110
setup-vp GitLab対応の裏側
naokihaba
0
150
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
APNsからLive Activityを開始する話
yumnumm
0
150
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
710
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
FreeBSDでZabbixを動かす
kenkino
0
360
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
390
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
310
ジョジョの世界をXRで再現する
mofurune
0
130
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
470
First, design no harm
axbom
PRO
2
1.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Invisible Side of Design
smashingmag
301
52k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
370
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
400
Statistics for Hackers
jakevdp
799
230k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
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