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
Go一緒にいかが?
Search
Ryuji Iwata
December 23, 2014
Programming
0
74
Go一緒にいかが?
Let's start the Go.
Ryuji Iwata
December 23, 2014
Tweet
Share
More Decks by Ryuji Iwata
See All by Ryuji Iwata
私のプログラミング人生のご紹介
qt_luigi
0
140
Azure AI Foundryのご紹介
qt_luigi
1
500
私なりのAIのご紹介 [2024年版]
qt_luigi
1
190
Azure ComputingとGo
qt_luigi
1
180
Go入門ハンズオン [準備編]
qt_luigi
1
110
Go入門ハンズオン [基礎編]
qt_luigi
1
120
本日のMicrosoft Azure
qt_luigi
0
120
私のEbitengineの第一歩
qt_luigi
0
690
私のMicrosoft Azure 2023
qt_luigi
0
350
Other Decks in Programming
See All in Programming
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
160
Improving my own Ruby thereafter
sisshiki1969
1
160
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
チームのテスト力を鍛える
goyoki
2
130
Deep Dive into Kotlin Flow
jmatsu
1
350
print("Hello, World")
eddie
2
530
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
270
Testing Trophyは叫ばない
toms74209200
0
880
AIコーディングAgentとの向き合い方
eycjur
0
270
個人軟體時代
ethanhuang13
0
320
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
What's in a price? How to price your products and services
michaelherold
246
12k
Six Lessons from altMBA
skipperchong
28
4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Unsuck your backbone
ammeep
671
58k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Transcript
Go一緒にいかが? GDG中国 - 第24回勉強会@岡山 2014.5.10
Who am I? package self import “introduction” const ( Name
= “Ryuji IWATA”, Twitter = “@qt_luigi”, Occupation = “Software Developer”)
おしながき ・Go言語とは? ・Goのセットアップ ・Goツールの紹介 ・Goの標準的な開発の流れ ・Goの文法の実例と解説
Go言語とは?
Go言語とは?(詳しくはWebへ!) ・コンパイル方式のプログラミング言語 ・2009年11月にオープンソースプロジェクト ・BSD, Linux, Mac OS X, Windows に対応
・Google App Engine (Experimental) にも対応 ・シンプルと速さ ・ガーベジコレクション ・クラスなし ・同時実行処理を実装しやすい
Goのセットアップ
ダウンロード 公式バイナリー http://code.google.com/p/go/wiki/Downloads 対応OS(Go 1.2.2 の場合) Linux 2.6.23 以降 (CentOS/RHEL
5.x 除く) Mac OS X 10.6 以降、FreeBSD 7 以降、 Windows 2000 以降 (2000 は Go 1.2 系まで) System requirements - http://golang.org/doc/install#requirements
インストール 標準のインストール先(= GOROOT) Windows:c:¥Go PC-UNIX:/usr/local/go ツール用にPATHを通す(= GOROOT/bin) Windows:c:¥Go¥bin PC-UNIX:/usr/local/go/bin Install
the Go tools - http://golang.org/doc/install#install tar -C /usr/local -xzf go1.2.2.linux-amd64.tar.gz
動作確認ファイル作成 テキストエディターにて「hello.go」ファイルをUTF-8 (BOMなし)で作成。 package main import “fmt” func main() {
fmt.Printf(“hello, world¥n”) }
セットアップ確認 「go run ファイル名」を実行して動作を確認。 ↑Goのプログラムをコンパイルして実行。 $ go run hello.go hello,
world
Goツールの紹介
go または go help goツールの機能や使い方を表示。 ~$ go Go is a
tool for managing Go source code. ... The commands are: build compile packages and dependencies clean remove object files env print Go environment information fix run go tool fix on packages ...
go env Goの環境情報を表示。 ~$ go env GOARCH="amd64" ... GOOS="darwin" GOPATH="/Users/ユーザー名/gocode"
... GOROOT="/usr/local/go" ...
go version Goのバージョンを表示。 詳細は「Goの標準的な開発の流れ」にて。 ~$ go version go version go1.2.2
darwin/amd64
go fmt ソースのフォーマットを整形。 ~$ vim pi.go package pi const(Pi=3.14) ~$
go fmt pi.go pi.go ~$ cat pi.go package pi const ( pi = 3.14 )
go get パッケージをダウンロードしてインストール。 GOPATHの設定が必要なので、実行する場 合は「Goの標準的な開発の流れ」の後で。 ~$ go get github.com/golang/lint ~$
ls $GOPATH/src/github.com/golang/lint LICENSE golint lint_test.go testdata README lint.go misc ~$ ls $GOPATH/pkg/darwin_amd64/github.com/golang/ lint.a
・Bitbucket (Git, Mercurial) ・GitHub (Git) ・Google Code Project Hosting (Git,
Mercurial, Subversion) ・Launchpad (Bazaar) Remote import paths - http://golang.org/cmd/go/#hdr-Remote_import_paths リモートリポジトリー
その他のGoツール go build, go install, go test 「Goの標準的な開発の流れ」内で紹介。 go clean,
go fix, go list, go tool, go vet 当方の理解不足や使用頻度から、今回は 割愛させて頂きましたm(__)m ちなみにgo cleanは実行するディレクトリーに よって削除対象のファイルが異なりますq@w@p
Goの標準的な開発の流れ
目的と内容 「Writing, building, installing, and testing Go code」を進めて、Goの標準的な開発の流れを学び ましょう! 使用する資料へのリンク
https://docs.google. com/document/d/1bh2GpXg4i81DrungtvoF6vowOeiaiQ MVbL0zhnvRgJA/pub
Goの文法の実例と解説
目的と内容 「Learn X in Y minutes」を進めて、Goの文法や実 例を学びましょう! 使用する資料へのリンク https://docs.google. com/document/d/1Y6xy40urFNf4lwFaOaXbwX8N-oA-
SQiRE7YAfBTC2sM/pub
Happy Hacking!