Skip to content

Commit 31c33fc

Browse files
authored
Merge pull request #735 from devlights/add-result-in-examples
2 parents fbf17cb + 01e486c commit 31c33fc

File tree

7 files changed

+42
-11
lines changed

7 files changed

+42
-11
lines changed

examples/basic/maths/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
このディレクトリには以下のサンプルがあります。
44

5-
| file | example name | note |
6-
|-----------|--------------|--------------------------------|
5+
| file | example name | note |
6+
| --------- | ------------ | ------------------------------------------------------ |
77
| minmax.go | minmax | MinMaxは各数値型の最小値と最大値を表示するサンプルです |
8-

examples/basic/maths/examples.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ func NewRegister() mapping.Register {
1313

1414
// Regist -- 登録します.
1515
func (r *register) Regist(m mapping.ExampleMapping) {
16-
m["minmax"] = MinMax
16+
m["maths_minmax"] = MinMax
1717
}

examples/basic/maths/minmax.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,22 @@ func MinMax() error {
2626
}
2727

2828
return nil
29+
30+
/*
31+
$ task
32+
task: [build] go build .
33+
task: [run] ./try-golang -onetime
34+
35+
ENTER EXAMPLE NAME: maths_minmax
36+
37+
[Name] "maths_minmax"
38+
Int8 Min[-128] Max[127]
39+
Int16 Min[-32768] Max[32767]
40+
Int32 Min[-2147483648] Max[2147483647]
41+
Int64 Min[-9223372036854775808] Max[9223372036854775807]
42+
43+
44+
[Elapsed] 320.06µs
45+
*/
46+
2947
}

examples/basic/methods/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
このディレクトリには以下のサンプルがあります。
44

5-
| file | example name | note |
6-
|---------------------|-----------------------------|------------------------------------------|
7-
| pointer\_or\_not.go | methods\_pointer\_or\_not | メソッドのレシーバーをポインタで宣言するかしないかの違いについてのサンプルです. |
8-
| methodvalue.go | methods\_method\_value | Goのメソッド値のサンプルです |
9-
| methodexpression.go | methods\_method\_expression | Goのメソッド式のサンプルです |
5+
| file | example name | note |
6+
| ------------------- | ------------------------- | ------------------------------------------------------------------------------- |
7+
| pointer_or_not.go | methods_pointer_or_not | メソッドのレシーバーをポインタで宣言するかしないかの違いについてのサンプルです. |
8+
| methodvalue.go | methods_method_value | Goのメソッド値のサンプルです |
9+
| methodexpression.go | methods_method_expression | Goのメソッド式のサンプルです |

examples/basic/methods/methodexpression.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ func MethodExpression() error {
4949
5050
[Elapsed] 6.16µs
5151
*/
52-
5352
}

examples/basic/methods/methodvalue.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,4 @@ func MethodValue() error {
4747
4848
[Elapsed] 7.22µs
4949
*/
50-
5150
}

examples/basic/methods/pointer_or_not.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,20 @@ func PointerOrNot() error {
3636
output.Stdoutl("[pointer ]", pointer.val)
3737

3838
return nil
39+
40+
/*
41+
$ task
42+
task: [build] go build .
43+
task: [run] ./try-golang -onetime
44+
45+
ENTER EXAMPLE NAME: methods_pointer_or_not
46+
47+
[Name] "methods_pointer_or_not"
48+
[non-pointer] 0
49+
[pointer ] 100
50+
51+
52+
[Elapsed] 35.15µs
53+
*/
54+
3955
}

0 commit comments

Comments
 (0)