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
71
Casualにインフラテストへ入門した話
yudoufu
2
4k
Other Decks in Programming
See All in Programming
CSC509 Lecture 12
javiergs
PRO
0
160
Functional Event Sourcing using Sekiban
tomohisa
0
110
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
260
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
6
1.7k
Welcome JSConf.jp 2024
yosuke_furukawa
PRO
0
710
Jakarta EE meets AI
ivargrimstad
0
850
Quine, Polyglot, 良いコード
qnighy
4
650
Ethereum_.pdf
nekomatu
0
470
Missing parts when designing and implementing Android UI
ericksli
0
250
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
350
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.3k
イベント駆動で成長して委員会
happymana
1
340
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Documentation Writing (for coders)
carmenintech
65
4.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
How STYLIGHT went responsive
nonsquared
95
5.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Bash Introduction
62gerente
608
210k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
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