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
let's go
Search
Andrews Medina
May 11, 2013
Programming
2
300
let's go
Uma introdução sobre a linguagem go no devcamp 2013
Andrews Medina
May 11, 2013
Tweet
Share
More Decks by Andrews Medina
See All by Andrews Medina
Organizando dados juŕidicos em grafos
andrewsmedina
0
88
Clean Code - princípios e práticas para um código sustentável
andrewsmedina
0
540
Pytfalls
andrewsmedina
1
180
tsuru para quem sabe tsuru
andrewsmedina
0
67
globo.com s2 python
andrewsmedina
5
360
tsuru and docker
andrewsmedina
6
3.5k
pypy - o interpretador mais rapido do velho oeste
andrewsmedina
0
350
fazendo deploys de forma simples e divertida com tsuru
andrewsmedina
3
130
TDD for Dummies
andrewsmedina
3
360
Other Decks in Programming
See All in Programming
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
0
120
自分だけの世界を創るクリエイティブコーディング / Creative Coding: Creating Your Own World
chobishiba
2
1k
Modern Functional Fluent CFML REST by Luis Majano
ortus24
0
140
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
220
Progressive Web Apps for Rails developers
siaw23
2
550
게임 개발하던 학생이이 세계에선 안드로이드 개발자?
pangmoo
0
110
実務未経験からいち早く戦力化するための新人エンジニア育成術 ~ 具体的な方法と育成する側の心得 ~
juri_matsuda
0
110
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
150
MLOps in Mercari Group’s Trust and Safety ML Team
cjhj
1
120
メルカリ ハロ アプリの技術スタック
atsumo
2
790
VS Code extension: ドラッグ&ドロップでファイルを並び替える
ttrace
0
170
5年分のツケを一気に払った話
soogie
3
1.3k
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
What's in a price? How to price your products and services
michaelherold
243
11k
The Language of Interfaces
destraynor
154
24k
Atom: Resistance is Futile
akmur
261
25k
GitHub's CSS Performance
jonrohan
1030
450k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How To Stay Up To Date on Web Technology
chriscoyier
787
250k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
9
1.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
Transcript
let’s go @andrewsmedina http://andrewsmedina.com let’s go Saturday, May 11, 2013
globo .com @andrewsmedina ‣ dev na globo.com ‣ faz parte
do time do tsuru paas ‣ contribui com projetos opensource (django, circus, splinter...) ‣ profeta nas horas vagas Saturday, May 11, 2013
globo .com por que go? Saturday, May 11, 2013
globo .com linguagens estáticas ‣ rápidas ‣ erros a nível
de compilação Saturday, May 11, 2013
globo .com http://www.thinkgeek.com/product/dac0/ Saturday, May 11, 2013
globo .com linguagens estáticas ‣ verbosas ‣ build lento Saturday,
May 11, 2013
globo .com linguagens dinâmicas ‣ sintaxe agradável Saturday, May 11,
2013
globo .com http://media.npr.org/assets/img/2012/08/20/slow-f7c667bbe3c1b9c54cf5061ade96c6799cef281b-s6-c10.jpg Saturday, May 11, 2013
globo .com linguagens dinâmicas ‣ lentas ‣ erro em runtime
Saturday, May 11, 2013
globo .com goals ‣ concorrência ‣ eficiência ‣ fácil ‣
divertida Saturday, May 11, 2013
globo .com let’s go Saturday, May 11, 2013
globo .com hello world package main import "fmt" func main()
{ fmt.Println("hello devcamp!") } Saturday, May 11, 2013
globo .com hello world 2 - a missão package main
import "fmt" func main() { nome := “andrews” fmt.Printf("meu nome é %s\n", nome) } Saturday, May 11, 2013
globo .com tipagem (estática) ‣ estática ‣ inferência de tipos
Saturday, May 11, 2013
globo .com for package main import "fmt" func main() {
for i := 0; i <= 10; i++ { fmt.Println(i) } } Saturday, May 11, 2013
globo .com primos func ehPrimo(numero int) bool { for i
:= 2; i < numero; i++ { if numero % i == 0 { return false } } return true } Saturday, May 11, 2013
globo .com primos cont.. func main() { numeros := []int{3,
5, 6, 7, 10, 11, 22, 32, 43, 111} for _, numero := range numeros { if ehPrimo(numero) { fmt.Printf("%d é primo.\n", numero) } } } Saturday, May 11, 2013
globo .com slices ‣ []type{item1, item2...} ‣ []int{1,2,3} Saturday, May
11, 2013
globo .com maps ‣ map[type]type ‣ map[string]string Saturday, May 11,
2013
globo .com types type Carro struct { Modelo string }
Saturday, May 11, 2013
globo .com types c := Carro{Modelo: "Gol"} Saturday, May 11,
2013
globo .com methods type Carro struct { Modelo string }
func (c *Carro) Acelera() { fmt.Printf("acelerando um %s...\n", c.Modelo) } Saturday, May 11, 2013
globo .com methods c := Carro{Modelo: "Gol"} c.Acelera() Saturday, May
11, 2013
globo .com interfaces type Aceleravel interface { Acelera() } Saturday,
May 11, 2013
globo .com interfaces type Moto struct { Modelo string }
func (m *Moto) Acelera() { fmt.Printf("vrummmmm\n") } Saturday, May 11, 2013
globo .com interfaces func aceleraQualquerCoisa(items []Aceleravel) { for _, aceleravel
:= range items { aceleravel.Acelera() } } Saturday, May 11, 2013
globo .com interfaces c := Carro{Modelo: "Gol"} m := Moto{Modelo:
"Harley"} aceleraQualquerCoisa([]Aceleravel{&c, &m}) Saturday, May 11, 2013
globo .com concorrência Saturday, May 11, 2013
globo .com bebedouro func main() { pessoas := []string{"andrews", "linus",
"fowler"} for _, p := range pessoas { pegaAgua(p) go bebeAgua(p) } time.Sleep(1) } Saturday, May 11, 2013
globo .com goroutine ‣ “go” Saturday, May 11, 2013
globo .com channels func soma(x, y int, c chan int)
{ c <- x + y } func main() { c := make(chan int) go soma(1, 1, c) go soma(2, 2, c) x, y := <-c, <-c fmt.Println(x+y) } Saturday, May 11, 2013
globo .com channels ‣ <- ‣ chan int Saturday, May
11, 2013
globo .com baterias incluídas ‣ crypto ‣ encoding ‣ html/template
‣ image ‣ log/syslog ‣ net/http, net/mail, net/smtp Saturday, May 11, 2013
globo .com baterias incluídas package main import ( "fmt" "net/http"
) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "devcamp 2013") }) http.ListenAndServe("127.0.0.1:3333", nil) } Saturday, May 11, 2013
globo .com baterias incluídas package main import ( "os" "text/template"
) func main() { t, _ := template.New("foo").Parse("Hello, {{.}}!") t.Execute(os.Stdout, "devcamp 2013") } Saturday, May 11, 2013
globo .com quem já está usando go ‣ google ‣
heroku ‣ mozilla ‣ globo.com ‣ canonical Saturday, May 11, 2013
globo .com #comofaz? ‣ http://tour.golang.org/ ‣ http://golang.org/doc/install ‣ http://golang.org/doc/code.html ‣
http://golang.org/doc/effective_go.html Saturday, May 11, 2013
let’s go @andrewsmedina http://andrewsmedina.com dúvidas? Saturday, May 11, 2013