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
90
Clean Code - princípios e práticas para um código sustentável
andrewsmedina
0
560
Pytfalls
andrewsmedina
1
180
tsuru para quem sabe tsuru
andrewsmedina
0
71
globo.com s2 python
andrewsmedina
5
360
tsuru and docker
andrewsmedina
6
3.5k
pypy - o interpretador mais rapido do velho oeste
andrewsmedina
0
360
fazendo deploys de forma simples e divertida com tsuru
andrewsmedina
3
140
TDD for Dummies
andrewsmedina
3
360
Other Decks in Programming
See All in Programming
初めてDefinitelyTypedにPRを出した話
syumai
0
400
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
ヤプリ新卒SREの オンボーディング
masaki12
0
130
最新TCAキャッチアップ
0si43
0
140
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Designing the Hi-DPI Web
ddemaree
280
34k
Designing for Performance
lara
604
68k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Being A Developer After 40
akosma
86
590k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
What's in a price? How to price your products and services
michaelherold
243
12k
RailsConf 2023
tenderlove
29
900
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