Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Go一緒にいかが?

 Go一緒にいかが?

Let's start the Go.

Avatar for Ryuji Iwata

Ryuji Iwata

December 23, 2014
Tweet

More Decks by Ryuji Iwata

Other Decks in Programming

Transcript

  1. Who am I? package self import “introduction” const ( Name

    = “Ryuji IWATA”, Twitter = “@qt_luigi”, Occupation = “Software Developer”)
  2. Go言語とは?(詳しくはWebへ!) ・コンパイル方式のプログラミング言語 ・2009年11月にオープンソースプロジェクト ・BSD, Linux, Mac OS X, Windows に対応

    ・Google App Engine (Experimental) にも対応 ・シンプルと速さ ・ガーベジコレクション ・クラスなし ・同時実行処理を実装しやすい
  3. ダウンロード 公式バイナリー 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
  4. 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 ...
  5. 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 )
  6. 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
  7. ・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 リモートリポジトリー
  8. その他の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