Submit Search
Upload
Go言語勉強会資料
•
0 likes
•
563 views
N
nametake
Follow
社内で「Go言語を採用するかも?」というチームに向けて行った勉強会の資料です。
Read less
Read more
Technology
Report
Share
Report
Share
1 of 49
Download now
Download to read offline
Recommended
#bphbqpstudy2012 LT riywo
#bphbqpstudy2012 LT riywo
Ryosuke IWANAGA
MVAunidiploma
MVAunidiploma
Matthew Vanier-Alleyne
Gitified by valentin bora
Gitified by valentin bora
Valentin Bora
Auszeichnung_Wasserdampftafeln
Auszeichnung_Wasserdampftafeln
Claus-Friedrich Grueber
JavaScript Tips
JavaScript Tips
裕介 藤木
07 4 for반복문
07 4 for반복문
Changwon National University
PyconRu 2016. Осторожно, DSL!
PyconRu 2016. Осторожно, DSL!
Ivan Tsyganov
Notarized Diploma
Notarized Diploma
Gerard Tabaloc
Recommended
#bphbqpstudy2012 LT riywo
#bphbqpstudy2012 LT riywo
Ryosuke IWANAGA
MVAunidiploma
MVAunidiploma
Matthew Vanier-Alleyne
Gitified by valentin bora
Gitified by valentin bora
Valentin Bora
Auszeichnung_Wasserdampftafeln
Auszeichnung_Wasserdampftafeln
Claus-Friedrich Grueber
JavaScript Tips
JavaScript Tips
裕介 藤木
07 4 for반복문
07 4 for반복문
Changwon National University
PyconRu 2016. Осторожно, DSL!
PyconRu 2016. Осторожно, DSL!
Ivan Tsyganov
Notarized Diploma
Notarized Diploma
Gerard Tabaloc
Introduction to Vim 8.0
Introduction to Vim 8.0
k-takata
エディタの壁を越えるGoの開発ツールの文化と作成法
エディタの壁を越えるGoの開発ツールの文化と作成法
Takuya Ueda
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべこと
Keisuke Nishitani
DevOpsとか言う前にAWSエンジニアに知ってほしいアプリケーションのこと
DevOpsとか言う前にAWSエンジニアに知ってほしいアプリケーションのこと
Terui Masashi
Sarvesh Singh Resume
Sarvesh Singh Resume
sarvesh singh
Penguinsrock
Penguinsrock
IsabelleSumOfUs
Gost r 53938 2010
Gost r 53938 2010
Raphael254
україна країна нескорених (1)
україна країна нескорених (1)
yanaanya
tid
tid
Erickzz Jauregui Picho
AKKA Technologies Singapore Services
AKKA Technologies Singapore Services
Pierre-Yves LAZIES
appraisal of groundwater quality in ado ekiti metropolitan area, nigeria
appraisal of groundwater quality in ado ekiti metropolitan area, nigeria
IJAEMSJORNAL
Comte e Marx
Comte e Marx
maria clara oliveira
Plagiarism.pptx ics
Plagiarism.pptx ics
maryamfarooqi
Equipment Financing & Leasing Budget
Equipment Financing & Leasing Budget
Fidelity Capital
BAEA: Architect Café 27/03/2014: Linking EA to change management
BAEA: Architect Café 27/03/2014: Linking EA to change management
BAEA
Search engines
Search engines
maryamfarooqi
More Related Content
Viewers also liked
Introduction to Vim 8.0
Introduction to Vim 8.0
k-takata
エディタの壁を越えるGoの開発ツールの文化と作成法
エディタの壁を越えるGoの開発ツールの文化と作成法
Takuya Ueda
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべこと
Keisuke Nishitani
DevOpsとか言う前にAWSエンジニアに知ってほしいアプリケーションのこと
DevOpsとか言う前にAWSエンジニアに知ってほしいアプリケーションのこと
Terui Masashi
Sarvesh Singh Resume
Sarvesh Singh Resume
sarvesh singh
Penguinsrock
Penguinsrock
IsabelleSumOfUs
Gost r 53938 2010
Gost r 53938 2010
Raphael254
україна країна нескорених (1)
україна країна нескорених (1)
yanaanya
tid
tid
Erickzz Jauregui Picho
AKKA Technologies Singapore Services
AKKA Technologies Singapore Services
Pierre-Yves LAZIES
appraisal of groundwater quality in ado ekiti metropolitan area, nigeria
appraisal of groundwater quality in ado ekiti metropolitan area, nigeria
IJAEMSJORNAL
Comte e Marx
Comte e Marx
maria clara oliveira
Plagiarism.pptx ics
Plagiarism.pptx ics
maryamfarooqi
Equipment Financing & Leasing Budget
Equipment Financing & Leasing Budget
Fidelity Capital
BAEA: Architect Café 27/03/2014: Linking EA to change management
BAEA: Architect Café 27/03/2014: Linking EA to change management
BAEA
Search engines
Search engines
maryamfarooqi
Viewers also liked
(16)
Introduction to Vim 8.0
Introduction to Vim 8.0
エディタの壁を越えるGoの開発ツールの文化と作成法
エディタの壁を越えるGoの開発ツールの文化と作成法
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべこと
DevOpsとか言う前にAWSエンジニアに知ってほしいアプリケーションのこと
DevOpsとか言う前にAWSエンジニアに知ってほしいアプリケーションのこと
Sarvesh Singh Resume
Sarvesh Singh Resume
Penguinsrock
Penguinsrock
Gost r 53938 2010
Gost r 53938 2010
україна країна нескорених (1)
україна країна нескорених (1)
tid
tid
AKKA Technologies Singapore Services
AKKA Technologies Singapore Services
appraisal of groundwater quality in ado ekiti metropolitan area, nigeria
appraisal of groundwater quality in ado ekiti metropolitan area, nigeria
Comte e Marx
Comte e Marx
Plagiarism.pptx ics
Plagiarism.pptx ics
Equipment Financing & Leasing Budget
Equipment Financing & Leasing Budget
BAEA: Architect Café 27/03/2014: Linking EA to change management
BAEA: Architect Café 27/03/2014: Linking EA to change management
Search engines
Search engines
Go言語勉強会資料
1.
2.
3.
4.
5.
6.
7.
8.
9.
export GOPATH=$HOME/go export PATH=$GOPATH/bin:$PATH $GOPATH ├── bin ├── pkg └── src $ go install $ go build
10.
$GOPATH/src/github.com/nametake/myapp
11.
12.
13.
14.
15.
16.
17.
‐ ‐ foo‐bar‐baz baz _ _
18.
※ package main import . "fmt" func main() { Println("period import") }
19.
$GOPATH
20.
$GOPATH/src/github.com/user/myapp/main.go package main func main() { ~~~ }
21.
myapp $GOPATH/src/github.com/user/myapp/cmd/myapp/main.go cmd/myapp‐batch
22.
23.
24.
file, err := os.Open("file.go") if err != nil { return err }
25.
type ParseError struct { Line, Col int } func (p ParseError) Error() string { return fmt.Sprintf(`parse error on line %d, column %d`, p.Line, p.Col) } switch err := err.(type) { case ParseError: PrintParseError(err) }
26.
file, err := os.Open("file.go") if err != nil { return err // ← }
27.
fmt.Errorf file, err := os.Open("file.go") if err != nil { return fmt.Errorf(`failed file open in foo: %s`, err) } :
28.
file, err := os.Open("file.go") if err != nil { return errors.Wrap(`failed file open in foo: %s`, err) } errors fmt.Errorf fmt.Errorf errors.Cause(err)
29.
30.
31.
func TestFoo(t *testing) { // Foo }
32.
func TestSuccessFoo(t *testing) { } func TestFailedFoo(t *testing) { } func TestFailedFooAtBarData(t *testing) { } ‐run
33.
func Fib(n int) int { if n < 2 { return n } return Fib(n‐1) + Fib(n‐2) }
34.
var fibTests = []struct { n int // input expected int // expected result }{ {1, 1}, {2, 1}, {3, 2}, {4, 3}, {5, 5}, {6, 8}, {7, 13}, } func TestFib(t *testing.T) { for _, tt := range fibTests { actual := Fib(tt.n) if actual != tt.expected { t.Errorf("Fib(%d): expected %d, actual %d", tt.n, tt.expected, actual) } } }
35.
_test _test package foo package foo_test ‐race
36.
37.
38.
type Talker interface { Talk() string }
39.
40.
41.
※
42.
err := dbmap.Insert(user) trans, _ := dbmap.Begin() trans.Insert(user) err := trans.Commit()
43.
type updater interface { Update(list ...interface{}) (int64, error) } func changeStatus(u updater, user *User) error { if user.IsLogin { user.Status = "active" } else { user.Status = "inactive" } row, err := u.Update(user) if err != nil { return err } return nil }
44.
type updater interface { Update(list ...interface{}) (int64, error) }
45.
46.
47.
type User struct { Name string Age int }
48.
type UserID string func (u *UserID) Valid() bool{ ~~~ID ~~~ } func User(id UserID) *User { ~~~User ~~~ }
Download now