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
5分で知るGo言語
Search
yudoufu
September 08, 2014
Programming
0
160
5分で知るGo言語
社内向けLTとして用意したGo言語の入門以前の紹介。
yudoufu
September 08, 2014
Tweet
Share
More Decks by yudoufu
See All by yudoufu
Project開始後に導入するAssetsの自動共有
yudoufu
2
3.4k
Drink Meetup with Mercari #36 Souzoh編
yudoufu
0
990
daemontools-kobanashi
yudoufu
0
73
Casualにインフラテストへ入門した話
yudoufu
2
4k
Other Decks in Programming
See All in Programming
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
940
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
420
DMMオンラインサロンアプリのSwift化
hayatan
0
190
Оптимизируем производительность блока Казначейство
lamodatech
0
950
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.1k
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.4k
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
Featured
See All Featured
Done Done
chrislema
182
16k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
What's in a price? How to price your products and services
michaelherold
244
12k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Optimizing for Happiness
mojombo
376
70k
Scaling GitHub
holman
459
140k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Code Review Best Practice
trishagee
65
17k
For a Future-Friendly Web
brad_frost
176
9.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Visualization
eitanlees
146
15k
Transcript
ͰΔ(Pݴޠ %BJDIJ,BNFNPUP $SPDPT)BDL)PVS
͜͜Ͱ͢͜ͱ w (Pݴޠʹ৮Εͨ͜ͱͳ͍ਓ͕ɺ5PVSPG(PΛ࢝ ΊΔͷʹࠔΒͳ͍Α͏ʹɺ)FMMP 8PSME·Ͱ ! w ·͊ɺͩ͠ɻ w ͕ٱʑLFZOPUF࡞Δ࿅श͔ͨͬ͠
SZ
ΞδΣϯμ w (Pݴޠͱ w (PQIFS w ڥΛ͑Δ w )FMMP8PSME w
جຊίϚϯυͱ͔
(Pݴޠͱ w (PPHMFͷ࡞ͬͨίϯύΠϧܕϓϩάϥϜݴޠ w ޙൃݴޠͳΒͰͷϞμϯͰॻ͖͍͢4ZOUBY w ίʔσΟϯάελΠϧܾΊΒΕͯΔ͠ɺެ͔ࣜΒϑΥʔ Ϛολ͕ఏڙ͞ΕͯΔ w ͕༰қͳ୯ҰόΠφϦ
w ๛ͳඪ४ύοέʔδ $ݴޠൺ͚ͩͲ w ಛʹฒྻॲཧ͚ͷػೳ͕๛
(Pݴޠͱ w ެࣜαΠτ w IUUQHPMBOHPSH w ΦϯϥΠϯ࣮ߦͱ͔ग़དྷΔεάϨϞϊ w 4UBCMF7FSTJPO
(PQIFS w ެࣜΩϟϥΫλʔ w Β͕͖͘෩ w ͖͍ w Ͳ͏ͯ͜͠͏ͳͬͨ
(PQIFS w ͵͍͙ΔΈ͋Δ w ΘΓͱछྨ͋Δ෩ ! w HPMBOH͢Δਓͷ͜ͱɺ HPQIFSͬͯݺͿΒ͍͠ɹ
ڥΛ͑Δ w ৽͍͠ͷͰɺΘΓͱ͍͍ϖʔεͰਐԽͯ͠Δ w खܰʹ৽͍͠ڥ͍͑ͨ w ͪΐ͍ݹใʹৼΓճ͞Εͳ͍Α͏ʹܰ͘հ
ίϯύΠϥͷ४උ w .BD ! w %FCJBO BOEBOZPUIFSMJOVY w QBDLBHF͕ݹ͍ͷͰɺHPEFCΛ͏ͱָ
! % wget https://godeb.s3.amazonaws.com/godeb-‐amd64.tar.gz % tar xvzf godeb-‐amd64.tar.gz % sudo ./godeb install 1.3.1 % brew install go
࡞ۀσΟϨΫτϦ w (01"5)ͱݺΕΔ࡞ۀσΟϨΫτϦ͕ඞཁ w ࣗͷ͖ͳॴʹ͍͍ͯ͠ w ྫ͑ɺ)0.&PQUHPΛ࡞ͬͯΔɻ % mkdir -‐p
$HOME/opt/go/src # srcඞਢʹͳΔͷͰ࡞ͬͱ͘ % echo ‘export GOPATH=$HOME/opt/go’ >> $HOME/.zshrc
࡞ۀσΟϨΫτϦ w (Pؔ࿈ͷQBDLBHFྨશ෦(01"5)ʹೖΔ w ࣗͷύοέʔδ͜͜Ͱ࡞Δ ! w ಈੜ͞ΕΔ . ├──
pkg │ └── darwin_amd64 │ ├── code.google.com │ ├── github.com │ └── honnef.co └── src ├── code.google.com │ └── p ├── github.com │ ├── crocos │ ├── golang │ ├── jstemmer │ ├── kisielk │ ├── mitchelh │ └── nsf └── honnef.co └── go
WJNʹ͍ͭͯ w WJNNFSͳΒ ࠷ॳ WJNHP͕Φεεϝ w IUUQTHJUIVCDPNGBUJIWJNHP w (Pʹඪ४ͷWJNαϙʔτ͋Δ֦͠ு͢Δ ͷ͋Δ͚Ͳɺ·ͣखܰͳͷͰ
w ·͊WJNઃఆ)FMMP 8PSMEޙͰ͍͍Μ͡ΌͶ
ิ w 2Α͘(03005ઃఆ͠ΖͬͯهࣄݟΔ͚Ͳʁ w "͋Εɺݹ͍ίϯύΠϧؔ࿈ઃఆͳΜͰɺHPEFC ͰೖΕΕؾʹ͠ͳͯ͘େৎͬ͢ w ࢀߟIUUQLXNUOFUJOEFYQIQ ZPVEPOUOFFEUPTFU HPSPPUSFBMMZ
)FMMP 8PSME w Կͱ͋ΕͬͯΈΑ͏ w ·ͣ࡞ۀσΟϨΫτϦΛ४උ ! w TSDҎԼΛϦϙδτϦ໊ͬΆ͘࡞Δ w
HPHFUͷϑΥʔϚοτʹ߹ΘͤͯΔΜͰ͢ % cd $GOPATH/src % mkdir -‐p github.com/crocos/go-‐helloworld # ྫ͑Ͷɻ % vim main.go
)FMMP 8PSME w ҙ w JOEFOUIBSEUBC w GVODNBJO \Χοίվߦ͠ͳ͍Ͱίί w
࢝·ΓNBJOQBDLBHFͷNBJO͔ؔΒ package main ! import “fmt” ! func main() { fmt.Println(“Hello, World!”) }
)FMMP 8PSME ! w ͘͠ ! w ʘ ?P? ʗ
% go run main.go # Hello, World! % go build main.go % ./go-‐helloworld
جຊతͳίϚϯυͱ͔ w ରϑΝΠϧΛίϯύΠϧ࣮ߦ w ಈ࡞ςετͳͲʹ͏ɻ ! w ରσΟϨΫτϦҎԼͷίϯύΠϧɺόΠφϦੜ %
go run main.go hoge.go … % go build
جຊతͳίϚϯυͱ͔ w ύοέʔδΛऔͬͯ͘Δ w ֎෦ϥΠϒϥϦΛऔಘͨ͠ΓɺύοέʔδΛ࣋ͬ ͖ͯͨΓ৭ʑ w (01"5)ͷԼʹల։͞ΕΔ % go
get github.com/crocos/rds-‐testrunner
͜ͷ͋ͱ w UPVSPGHP w IUUQHPUPVSKQBQQTQPUDPN w HPMBOHKQߋ৽͞Εͯͳ͍ͷͰݟͪΌμϝ w ࠓ݄ͷ8&# %#
w &⒎FDUJWF(P w IUUQTHPMBOHPSHEPDF⒎FDUJWF@HPIUNM