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
370
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
370
Other Decks in Programming
See All in Programming
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
770
MCP with Cloudflare Workers
yusukebe
2
220
From Translations to Multi Dimension Entities
alexanderschranz
2
130
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
Recoilを剥がしている話
kirik
5
6.6k
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
350
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
260
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
For a Future-Friendly Web
brad_frost
175
9.4k
Faster Mobile Websites
deanohume
305
30k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
The Language of Interfaces
destraynor
154
24k
4 Signs Your Business is Dying
shpigford
181
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
The Cost Of JavaScript in 2023
addyosmani
45
7k
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