File tree Expand file tree Collapse file tree 5 files changed +68
-7
lines changed
Expand file tree Collapse file tree 5 files changed +68
-7
lines changed Original file line number Diff line number Diff line change 1- # サンプルリスト
1+ # サンプルリスト
22
33このディレクトリには以下のサンプルがあります。
44
5- | file | example name | note |
6- | ----------------------------| -------------------------| ---------------------------------|
7- | scope \_ basic .go | scope \_ basic | スコープについての基本的な事項についてのサンプルです. |
8- | scope \_ common \_ mistake1 .go | scope \_ common \_ mistake1 | 変数宣言のスコープによるよくやる間違いについてのサンプルです. |
9- | scope \_ common \_ mistake2 .go | scope \_ common \_ mistake2 | CommonMistake1の間違い修正パターン (1) |
10- | scope \_ common \_ mistake3 .go | scope \_ common \_ mistake3 | CommonMistake1の間違い修正パターン (2) |
5+ | file | example name | note |
6+ | ------------------------ | --------------------- | ------------------------------------------------------------- |
7+ | scope_basic .go | scope_basic | スコープについての基本的な事項についてのサンプルです. |
8+ | scope_common_mistake1 .go | scope_common_mistake1 | 変数宣言のスコープによるよくやる間違いについてのサンプルです. |
9+ | scope_common_mistake2 .go | scope_common_mistake2 | CommonMistake1の間違い修正パターン (1) |
10+ | scope_common_mistake3 .go | scope_common_mistake3 | CommonMistake1の間違い修正パターン (2) |
1111
Original file line number Diff line number Diff line change @@ -29,6 +29,20 @@ func Basic() error {
2929 ShowValues (& hasNoPublicFields )
3030
3131 return nil
32+
33+ /*
34+ $ task
35+ task: Task "build" is up to date
36+ task: [run] ./try-golang -onetime
37+
38+ ENTER EXAMPLE NAME: scope_basic
39+
40+ [Name] "scope_basic"
41+ [*mypkg.HasPublicFields] &{Val1:100 Val2:Test Value}
42+ [*mypkg.HasNoPublicFields] &{val1:0 val2:}
43+
44+ [Elapsed] 32.711µs
45+ */
3246}
3347
3448// ShowValues -- サンプル関数
Original file line number Diff line number Diff line change @@ -45,4 +45,19 @@ func CommonMistake1() error {
4545 // -------------------------------------------------------------------------
4646
4747 return nil
48+
49+ /*
50+ $ task
51+ task: [build] go build .
52+ task: [run] ./try-golang -onetime
53+
54+ ENTER EXAMPLE NAME: scope_common_mistake1
55+
56+ [Name] "scope_common_mistake1"
57+ [loadcwd] /workspace/try-golang
58+ [main]
59+
60+ [Elapsed] 30.79µs
61+ */
62+
4863}
Original file line number Diff line number Diff line change @@ -34,4 +34,20 @@ func CommonMistake2() error {
3434 output .Stdoutl ("[main]" , _cwd2 )
3535
3636 return nil
37+
38+ /*
39+ $ task
40+ task: [build] go build .
41+ task: [run] ./try-golang -onetime
42+
43+ ENTER EXAMPLE NAME: scope_common_mistake2
44+
45+ [Name] "scope_common_mistake2"
46+ [loadcwd] /workspace/try-golang
47+ [main] /workspace/try-golang
48+
49+
50+ [Elapsed] 40.04µs
51+ */
52+
3753}
Original file line number Diff line number Diff line change @@ -37,4 +37,20 @@ func CommonMistake3() error {
3737 output .Stdoutl ("[main]" , pkginfo .cwd )
3838
3939 return nil
40+
41+ /*
42+ $ task
43+ task: [build] go build .
44+ task: [run] ./try-golang -onetime
45+
46+ ENTER EXAMPLE NAME: scope_common_mistake3
47+
48+ [Name] "scope_common_mistake3"
49+ [loadcwd] /workspace/try-golang
50+ [main] /workspace/try-golang
51+
52+
53+ [Elapsed] 48.82µs
54+ */
55+
4056}
You can’t perform that action at this time.
0 commit comments