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
550
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
350
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
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.4k
イベント駆動で成長して委員会
happymana
1
250
Java ジェネリクス入門 2024
nagise
0
670
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
260
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
290
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
270
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
200
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
140
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.3k
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
2.2k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
490
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
750
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
How GitHub (no longer) Works
holman
310
140k
Become a Pro
speakerdeck
PRO
25
5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
What's in a price? How to price your products and services
michaelherold
243
12k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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